{"record":{"id":"abe774f1cb930aa9","repo":"risingwavelabs/risingwave","slug":"progress-table-columns-len-not-matched-with-the-le","errorCode":null,"errorMessage":"progress table columns len not matched with the len derived from upstream table pk. progress table: {:?}, pk: {:?}","messagePattern":"progress table columns len not matched with the len derived from upstream table pk\\. progress table: (.+?), pk: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/executor/backfill/snapshot_backfill/state.rs","lineNumber":59,"sourceCode":"}\n\n/// `vnode`, `epoch`, `row_count`, `is_finished`\nconst EXTRA_COLUMN_TYPES: [DataType; 4] = [\n    DataType::Int16,\n    DataType::Int64,\n    DataType::Int64,\n    DataType::Boolean,\n];\n\nimpl VnodeBackfillProgress {\n    fn validate_progress_table_schema(\n        progress_table_column_types: &[DataType],\n        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                );","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/backfill/snapshot_backfill/state.rs#L41-L77","documentation":"The backfill progress (state) table's column count does not match the expected count: the upstream table's primary key columns plus the fixed extra columns (`EXTRA_COLUMN_TYPES`). The progress table must mirror this schema exactly to record per-vnode progress.","triggerScenarios":"`validate_progress_table_schema` is called with a progress table created by a different schema version than the one derived from the current upstream table PK — e.g. the upstream table's PK/distribution changed, or the progress table was created by an older RisingWave version.","commonSituations":"Upgrading a cluster across versions where the progress table schema changed; manually altering the upstream table's primary key; restoring a progress table from a mismatched source.","solutions":["Recreate the materialized view/table so the progress table is regenerated with the current expected schema.","Check RisingWave version compatibility of persisted progress tables before/after upgrade (see release notes for backfill state format changes).","Compare the progress table definition with the upstream table PK columns and fix whichever was changed unexpectedly."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"assert_eq!(progress_table.column_types().len(), EXTRA_COLUMN_TYPES.len() + upstream_pk.len(), \"progress table schema mismatch\");","typeGuard":null,"tryCatchPattern":"if let Err(e) = BackfillState::validate_progress_table_schema(&pt, &pk) { recreate_backfill_state(); return Err(e); }","preventionTips":["Recreate MVs/tables after version upgrades that change backfill state format","Never manually alter progress or source table PKs","Validate persisted state schemas at recovery time before use"],"tags":["schema","backfill","validation"],"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"}