{"record":{"id":"ebfe8492671c7c58","repo":"risingwavelabs/risingwave","slug":"prev-version-not-found","errorCode":null,"errorMessage":"prev_version {} not found","messagePattern":"prev_version (.+?) not found","errorType":"exception","errorClass":"TimeTravel","httpStatus":null,"severity":"error","filePath":"src/meta/src/hummock/manager/time_travel.rs","lineNumber":343,"sourceCode":"                if sst_ids_to_delete.len() >= delete_sst_batch_size {\n                    delete_sst_in_batch(\n                        &txn,\n                        std::mem::take(&mut sst_ids_to_delete),\n                        delete_sst_batch_size,\n                    )\n                    .await?;\n                }\n                let new_object_ids = delta_to_delete.newly_added_object_ids();\n                object_ids_to_delete.extend(&new_object_ids - &retained_snapshot_object_ids);\n            }\n        }\n        for prev_version_id in version_ids_to_delete {\n            let prev_version = {\n                let prev_version = hummock_time_travel_version::Entity::find_by_id(prev_version_id)\n                    .one(&txn)\n                    .await?\n                    .ok_or_else(|| {\n                        Error::TimeTravel(anyhow!(format!(\n                            \"prev_version {} not found\",\n                            prev_version_id\n                        )))\n                    })?;\n                IncompleteHummockVersion::from_persisted_protobuf_owned(\n                    prev_version.version.to_protobuf(),\n                )\n            };\n            let sst_ids = prev_version.get_sst_ids();\n            sst_ids_to_delete.extend(&sst_ids - &retained_snapshot_sst_ids);\n            if sst_ids_to_delete.len() >= delete_sst_batch_size {\n                delete_sst_in_batch(\n                    &txn,\n                    std::mem::take(&mut sst_ids_to_delete),\n                    delete_sst_batch_size,\n                )\n                .await?;\n            }","sourceCodeStart":325,"sourceCodeEnd":361,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/hummock/manager/time_travel.rs#L325-L361","documentation":"During time-travel metadata truncation, each previous-version ID planned for deletion is looked up in the hummock_time_travel_version table inside the transaction. If find_by_id returns no row, the code returns Error::TimeTravel(\"prev_version {} not found\") — a lookup failure indicating the version row is missing while the deletion plan still references it.","triggerScenarios":"Calling delete_time_travel_metadata when a hummock_time_travel_version row for prev_version_id was already removed (concurrent truncation, manual DB cleanup) or the pinning/version snapshot lists versions that no longer exist in the store.","commonSituations":"Racing version GC workers; manual deletes against the meta store database; corrupted or partially restored meta store after a crash or restore operation.","solutions":["Check the hummock_time_travel_version table for the reported version id to confirm it is genuinely missing.","Prevent concurrent time-travel GC from running in parallel; run a single GC coordinator.","Restore meta store consistency from a backup or rebuild time-travel metadata if rows are missing.","File a bug with logs and the version id — a missing row here usually signals an internal consistency bug."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// verify prev-version rows exist before planning deletion\nlet existing: HashSet<_> = version_ids_to_delete.iter()\n    .filter(|id| version_exists_in_store(id))\n    .cloned().collect();\nlet dangling: Vec<_> = version_ids_to_delete.difference(&existing).collect();\nif !dangling.is_empty() { /* abort: inconsistent metadata */ }","typeGuard":null,"tryCatchPattern":"// catch the typed error and treat as consistency alarm\nmatch meta.delete_time_travel_metadata(...).await {\n    Err(Error::TimeTravel(e)) if e.to_string().contains(\"prev_version\") => {\n        // halt GC, snapshot meta store state for diagnosis\n    }\n    other => other,\n}","preventionTips":["Serialize time-travel metadata deletion; forbid parallel GC tasks.","Do not hand-edit hummock_time_travel_version rows.","Restore the meta store from a single consistent backup snapshot.","Log and report occurrences — usually an internal bug worth filing upstream."],"tags":["time-travel","hummock","metadata","risingwave-meta"],"backgroundTag":"record-not-found","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"}