{"record":{"id":"70cdd6add226d991","repo":"risingwavelabs/risingwave","slug":"invalid-backfill-state-cdc-offset-high","errorCode":null,"errorMessage":"invalid backfill state: cdc_offset_high","messagePattern":"invalid backfill state: cdc_offset_high","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/executor/backfill/cdc/state_v2.rs","lineNumber":89,"sourceCode":"                };\n                let row_count = match state[2] {\n                    Some(ScalarImpl::Int64(val)) => val,\n                    _ => return Err(anyhow!(\"invalid backfill state: row_count\").into()),\n                };\n                let (cdc_offset_low, cdc_offset_high) = if !self.is_legacy_state {\n                    let cdc_offset_low = match state[3] {\n                        Some(ScalarImpl::Jsonb(ref jsonb)) => {\n                            serde_json::from_value(jsonb.clone().take()).unwrap()\n                        }\n                        None => None,\n                        _ => return Err(anyhow!(\"invalid backfill state: cdc_offset_low\").into()),\n                    };\n                    let cdc_offset_high = match state[4] {\n                        Some(ScalarImpl::Jsonb(ref jsonb)) => {\n                            serde_json::from_value(jsonb.clone().take()).unwrap()\n                        }\n                        None => None,\n                        _ => return Err(anyhow!(\"invalid backfill state: cdc_offset_high\").into()),\n                    };\n                    (cdc_offset_low, cdc_offset_high)\n                } else {\n                    (None, None)\n                };\n\n                Ok(CdcStateRecord {\n                    is_finished,\n                    row_count,\n                    cdc_offset_low,\n                    cdc_offset_high,\n                })\n            }\n            None => Ok(CdcStateRecord::default()),\n        }\n    }\n\n    /// Modify the state of the corresponding split","sourceCodeStart":71,"sourceCodeEnd":107,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/executor/backfill/cdc/state_v2.rs#L71-L107","documentation":"Thrown by CdcBackfillStateV2::restore_state when element [4] of the persisted state row is neither a Jsonb-encoded CDC offset nor null, so cdc_offset_high cannot be deserialized. Same guard as cdc_offset_low but for the high watermark offset.","triggerScenarios":"Restoring a non-legacy v2 CDC backfill state where state[4] holds a scalar other than Jsonb/None, e.g. a row written by an incompatible encoder or a truncated write.","commonSituations":"Version mismatch after upgrade; legacy rows read by v2 executor; state corruption from interrupted persistence.","solutions":["Cancel and recreate the streaming job to rebuild the backfill state","Align all nodes on one RisingWave version so state encoding is consistent","Inspect the internal state table row to confirm the cdc_offset_high field type","Recreate the CDC table/MV from the upstream if the persisted state is unrecoverable"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"let high_ok = matches!(state[STATE_OFFSET_HIGH_IDX], None | Some(ScalarImpl::Jsonb(_)));\nif !high_ok { /* recreate the streaming job */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run a homogeneous cluster version for state encoding","Avoid killing compute nodes mid-backfill (interrupted state writes)"],"tags":["rust","streaming","cdc","state-restore","json"],"backgroundTag":"type-mismatch","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"}