Bug Description
In crates/partition-store/src/journal_table_v2/mod.rs, the delete_journal function has a copy-paste bug on line 309: the second deletion loop (intended to clean up completion-id-to-command-index entries with prefix b"jc") incorrectly scans using the notification-id prefix (b"jn") instead.
Since the first loop already deletes all b"jn" entries, the second scan returns an empty iterator, and completion-id index entries (b"jc" prefix) are never cleaned up. This causes orphaned index entries to accumulate in RocksDB over time.
Impact
- Gradual storage bloat from orphaned
b"jc" index entries
- Potential stale lookups if completion IDs are reused (unlikely in practice)
Fix
On line 309, change:
notification_id_to_notification_index.clone(),
to:
completion_id_to_command_index.clone(),
Also, the variable name notification_id_index on line 306 should be renamed to completion_id_index (copy-paste artifact from line 282).
Found During
Code review of #4354 (invoker memory budget). This bug is pre-existing and unrelated to the memory budget changes.