{"record":{"id":"a701822ea3c7eca9","repo":"risingwavelabs/risingwave","slug":"progress-table-column-not-matched-with-upstream-ta","errorCode":null,"errorMessage":"progress table column not matched with upstream table schema: progress table: {:?}, pk: {:?}","messagePattern":"progress table column not matched with upstream table schema: progress table: (.+?), pk: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/executor/backfill/snapshot_backfill/state.rs","lineNumber":72,"sourceCode":"        upstream_pk_column_types: &[DataType],\n    ) -> StreamExecutorResult<()> {\n        if progress_table_column_types.len()\n            != EXTRA_COLUMN_TYPES.len() + upstream_pk_column_types.len()\n        {\n            return Err(anyhow!(\n                \"progress table columns len not matched with the len derived from upstream table pk. progress table: {:?}, pk: {:?}\",\n                progress_table_column_types,\n                upstream_pk_column_types)\n                .into()\n            );\n        }\n        for (expected_type, progress_table_type) in EXTRA_COLUMN_TYPES\n            .iter()\n            .chain(upstream_pk_column_types.iter())\n            .zip_eq_debug(progress_table_column_types.iter())\n        {\n            if expected_type != progress_table_type {\n                return Err(anyhow!(\n                    \"progress table column not matched with upstream table schema: progress table: {:?}, pk: {:?}\",\n                    progress_table_column_types,\n                    upstream_pk_column_types)\n                    .into()\n                );\n            }\n        }\n        Ok(())\n    }\n\n    pub(super) fn from_row(row: &OwnedRow, pk_serde: &OrderedRowSerde) -> Self {\n        assert_eq!(\n            row.len(),\n            pk_serde.get_data_types().len() + EXTRA_COLUMN_TYPES.len() - 1, /* Pk of the progress state table (i.e. vnode column) not included */\n        );\n        let epoch = must_match!(&row[0], Some(ScalarImpl::Int64(epoch)) => {\n           *epoch as u64\n        });","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/backfill/snapshot_backfill/state.rs#L54-L90","documentation":"The progress table's column types do not match, position by position, the expected sequence of `EXTRA_COLUMN_TYPES` followed by the upstream table's PK column types. Same schema-contract as the length check, but at the type level.","triggerScenarios":"A progress table whose columns have different `DataType`s than expected — e.g. PK column type changed upstream (INT → BIGINT), or the progress table was created with legacy/different types.","commonSituations":"Schema drift between the source table and the persisted progress table; restoring state from backup of a different table definition; version upgrades that changed type mapping.","solutions":["Recreate the target MV/table so a fresh progress table is built from the current upstream schema.","Diff the actual progress table column types against `EXTRA_COLUMN_TYPES` + upstream PK types and align the source of drift.","Verify no manual schema alteration was applied to the progress or source table."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"for (expected, actual) in EXTRA_COLUMN_TYPES.iter().chain(pk_types.iter()).zip(pt_types.iter()) { if expected != actual { return Err(anyhow!(\"type mismatch: {expected:?} vs {actual:?}\")); } }","typeGuard":null,"tryCatchPattern":"if let Err(e) = BackfillState::validate_progress_table_schema(&pt, &pk) { drop_and_recreate_state(); return Err(e); }","preventionTips":["Diff progress table types against the upstream PK after any source schema change","Avoid restoring progress tables from mismatched backups","Run schema validation as a preflight during backfill state recovery"],"tags":["schema","backfill","type-mismatch"],"backgroundTag":"schema-validation-failed","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}