{"record":{"id":"15a6b896b793db4a","repo":"risingwavelabs/risingwave","slug":"checkpoint-missing-required-field-version","errorCode":null,"errorMessage":"checkpoint missing required field `version`","messagePattern":"checkpoint missing required field `version`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/meta/src/hummock/manager/checkpoint.rs","lineNumber":153,"sourceCode":"                expected,\n                actual\n            )\n            .into());\n        }\n\n        let algo = CheckpointCompressionAlgorithm::try_from(envelope.compression_algorithm)\n            .with_context(|| {\n                format!(\n                    \"unknown checkpoint compression algorithm: {}\",\n                    envelope.compression_algorithm\n                )\n            })?;\n\n        let decompressed = decompress_payload(algo, &envelope.payload)?;\n        let ckpt = PbHummockVersionCheckpoint::decode(decompressed.as_ref())\n            .context(\"failed to decode checkpoint envelope payload\")?;\n        if ckpt.version.is_none() {\n            return Err(anyhow::anyhow!(\"checkpoint missing required field `version`\").into());\n        }\n\n        tracing::info!(\n            compression = ?algo,\n            compressed_size = envelope.payload.len(),\n            decompressed_size = decompressed.len(),\n            compression_ratio =\n                format!(\"{:.2}x\", decompressed.len() as f64 / envelope.payload.len().max(1) as f64),\n            checksum = format!(\"{expected:#x}\"),\n            \"decoded compressed checkpoint\"\n        );\n        return Ok(ckpt);\n    }\n\n    // Legacy uncompressed format\n    tracing::info!(\n        data_size,\n        \"decoding checkpoint in legacy uncompressed format\"","sourceCodeStart":135,"sourceCodeEnd":171,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/hummock/manager/checkpoint.rs#L135-L171","documentation":"The decompressed checkpoint payload decoded as PbHummockVersionCheckpoint but lacks the required `version` field, so decode_checkpoint_data rejects it. The `version` field identifies the checkpoint format and is mandatory in the enveloped format.","triggerScenarios":"decode_checkpoint_data decodes an envelope, decompresses it, and finds ckpt.version == None — i.e. the payload was produced without setting version (legacy/foreign writer) or the payload is corrupt in a way that still decodes.","commonSituations":"Mixing checkpoint data written by an old RisingWave version with a new enveloped reader; manual manipulation of checkpoint objects; a writer bug that omitted the version field.","solutions":["Ensure the checkpoint was written by a compatible RisingWave version (the legacy path handles old formats)","Restore the checkpoint object from a backup written by the same version","If migrating old data, use the legacy decode fallback rather than feeding legacy bytes to the enveloped path","Check writer code to confirm version is always set when constructing the checkpoint"],"exampleFix":"// before (writer)\nlet ckpt = PbHummockVersionCheckpoint { payload: Some(p), version: None };\n// after\nlet ckpt = PbHummockVersionCheckpoint { payload: Some(p), version: Some(CURRENT_CHECKPOINT_VERSION) };","handlingStrategy":"validation","validationCode":"// Writer-side: ensure version is always set before serializing\nassert!(ckpt.version.is_some(), \"checkpoint must carry a version field\");\n","typeGuard":"fn has_version(ckpt: &PbHummockVersionCheckpoint) -> bool { ckpt.version.is_some() }\n","tryCatchPattern":"match try_read_checkpoint(store, id).await {\n    Err(e) if e.to_string().contains(\"missing required field `version`\") => {\n        tracing::warn!(\"incompatible/corrupt checkpoint {id}: {e:#}\");\n        // fall back to a prior checkpoint or re-bootstrap\n    }\n    other => other?,\n}\n","preventionTips":["Always set the version field when writing checkpoints","Avoid mixing checkpoint objects across RisingWave versions","Validate restored objects before swapping them in","Keep legacy-format data on the legacy decode path"],"tags":["rust","hummock","checkpoint","protobuf"],"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-23T08:17:48.524Z"}