{"record":{"id":"43c2cb9df8f2a4d8","repo":"influxdata/influxdb","slug":"row-delete-predicate-version-exceeds-u64","errorCode":null,"errorMessage":"row_delete_predicate_version exceeds u64","messagePattern":"row_delete_predicate_version exceeds u64","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/catalog/migrations/v3.rs","lineNumber":268,"sourceCode":"    /// the Stopped state on apply.\n    fn from_v2(&self, batch: &mut RecordBatch) {\n        let registered_time_ns = match &self.state {\n            NodeStateSnapshot::Running { registered_time_ns } => *registered_time_ns,\n            NodeStateSnapshot::Stopped { .. } => 0,\n        };\n\n        batch.push(&RegisterNode {\n            node_catalog_id: self.node_catalog_id.get(),\n            node_id: self.node_id.to_string(),\n            instance_id: self.instance_id.to_string(),\n            registered_time_ns,\n            core_count: self.core_count,\n            mode: self.mode.iter().copied().map(Into::into).collect(),\n            process_uuid: [0u8; 16], // placeholder -- not preserved in v2\n            conn_info: self.conn_info.as_ref().map(|s| s.to_string()),\n            cli_params: self.cli_params.as_ref().map(|s| s.to_string()),\n            row_delete_predicate_version: u64::try_from(self.row_delete_predicate_version)\n                .expect(\"row_delete_predicate_version exceeds u64\"),\n            // v2 has no concept of feature level:\n            feature_level: FeatureLevel::ZERO,\n        });\n\n        if let NodeStateSnapshot::Stopped { stopped_time_ns } = &self.state {\n            batch.push(&StopNode {\n                node_catalog_id: self.node_catalog_id.get(),\n                node_id: self.node_id.to_string(),\n                stopped_time_ns: *stopped_time_ns,\n                process_uuid: [0u8; 16], // placeholder -- not preserved in v2\n            });\n        }\n    }\n}\n\nimpl FromV2 for DatabaseSnapshot {\n    fn from_v2(&self, batch: &mut RecordBatch) {\n        let db_id = self.id.get();","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/catalog/migrations/v3.rs#L250-L286","documentation":"A `.expect(...)` panic in the v2->v3 migration while converting a `NodeSnapshot` into a `RegisterNode` record: the v2 `row_delete_predicate_version` value is converted with `u64::try_from` and asserted to fit. The type in the v2 snapshot is apparently signed/wider, and a negative or out-of-range value cannot be represented as u64 in v3.","triggerScenarios":"Running the v2->v3 migration when a node entry in the v2 catalog has `row_delete_predicate_version` that is negative or otherwise unrepresentable as u64 (e.g. i64::MIN, corrupt value).","commonSituations":"Corrupted or hand-edited v2 catalog objects; test fixtures with sentinel values like -1; catalogs written by older builds with a differently-typed version field.","solutions":["Inspect the node entries in the v2 catalog and fix/reset `row_delete_predicate_version` to a valid non-negative version (usually 0 or 1).","Restore the v2 catalog object from a known-good backup.","Replace the `expect` with a fallible mapping that returns `MigrationError::Unexpected` so migration fails gracefully.","Check for tooling/scripts writing sentinel (-1) versions into the v2 catalog and remove them."],"exampleFix":"// before\n.expect(\"row_delete_predicate_version exceeds u64\"),\n// after\nrow_delete_predicate_version: u64::try_from(self.row_delete_predicate_version)\n    .map_err(|_| MigrationError::Unexpected(anyhow::anyhow!(\"invalid row_delete_predicate_version {}\", self.row_delete_predicate_version)))?,","handlingStrategy":"validation","validationCode":"fn row_delete_predicate_version_is_valid(v: i64) -> bool { v >= 0 }","typeGuard":"fn as_u64(v: i64) -> Option<u64> { u64::try_from(v).ok() }","tryCatchPattern":"// panic path; guard any code that writes this field\nlet version = as_u64(raw).ok_or_else(|| anyhow!(\"row_delete_predicate_version must be non-negative\"))?;","preventionTips":["Never store sentinel values like -1 in version fields.","Validate version fields as non-negative at every writer.","Audit v2 catalog contents with as_u64 before running the migration.","Keep catalog-writing tooling on current, validated schemas."],"tags":["influxdb3","catalog-migration","overflow","panic","rust"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}