databendlabs/databend · error

internal error: expect some TxnGetResponseGet, but got

Error message

internal error: expect some TxnGetResponseGet, but got {:?}

What it means

update_multi_table_meta_with_sender performs a transaction that fetches current table meta for each table being updated (to compare versions) and asserts every response is a Get response. If any response in else_branch_op_responses is not Response::Get, this unreachable!() panics with the actual variant. This indicates the meta txn layer replied with an unexpected response type to a plain read — an internal invariant violation, since version-conflict paths are supposed to surface as a failed txn predicate instead.

Solutions

  1. Confirm all meta nodes are on the same version; upgrade/roll back to a consistent release
  2. Retry update_multi_table_meta — if it panics repeatedly for one table id, inspect that table's meta entries in the store
  3. Gather the panic log (it prints the unexpected response variant) and file a meta-service bug
  4. Reduce concurrent DDL on the same tables until the root cause is fixed
Defensive patterns

Strategy: retry

Type guard

fn as_get(resp: &Response) -> Option<&GetResponse> { if let Response::Get(g) = resp { Some(g) } else { None } }

Try / catch

match &resp.response { Response::Get(g) => g, other => { log::error!("unexpected: {:?}", other); return retry(); } }

Prevention

When it happens

Trigger: Calling update_multi_table_meta (e.g. during table option/cluster-key updates) where the txn else-branch responses include a non-Get response for one of the requested table ids — usually caused by mixed meta versions or a protocol-level bug.

Common situations: Concurrent DDL on the same table hitting the version-check path while a meta node returns a malformed response; clusters with inconsistent meta-node versions after a rolling upgrade.

Related errors


AI-assisted analysis of databendlabs/databend@288d84d76e (2026-09-11). Data as JSON: /api/errors/8b3bac3e63f9a88d. Report an issue: GitHub.

Appendix: source

Thrown at src/meta/api/src/api_impl/table_api.rs:1594

                return Ok(Ok(UpdateTableMetaReply {}));
            }
            IdempotentKVTxnResponse::AlreadyCommitted => {
                info!(
                    "Transaction ID {} exists, the corresponding update_multi_table_meta transaction has been executed successfully",
                    txn_sender.get_txn_id()
                );
                return Ok(Ok(UpdateTableMetaReply {}));
            }
            IdempotentKVTxnResponse::Failed(op_responses) => op_responses,
        };

        let mut mismatched_tbs = vec![];
        for (resp, req) in else_branch_op_responses
            .iter()
            .zip(update_table_metas.iter())
        {
            let Some(Response::Get(get_resp)) = &resp.response else {
                unreachable!(
                    "internal error: expect some TxnGetResponseGet, but got {:?}",
                    resp.response
                )
            };
            // deserialize table version info
            let (tb_meta_seq, table_meta): (_, TableMeta) = if let Some(seq_v) = &get_resp.value {
                (seq_v.seq, deserialize_struct(&seq_v.data)?)
            } else {
                return Err(KVAppError::AppError(AppError::UnknownTableId(
                    UnknownTableId::new(req.0.table_id, "update_multi_table_meta"),
                )));
            };

            // check table version
            if req.0.seq.match_seq(&tb_meta_seq).is_err() {
                mismatched_tbs.push((req.0.table_id, tb_meta_seq, table_meta));
            }
        }

View on GitHub (pinned to 288d84d76e)