Skip to content

server-ng: partition journal repair resurrects purged data after restart #3793

Description

@krishvishal

Bug description

Summary

PurgeTopic mutates partition state out of band (metadata op → reconciler → pump) and never
touches the partition journal. Superseded ops stay repairable. After a node restart, partition
journal repair replays them and undoes the purge.

The partition plane has no checkpoint, so there is no repair floor a purge can advance.

Repro

cargo nextest run --features vsr --retries 0 \
  -E 'test(/should_purge_topic_and_clear_consumer_offsets.*restart_on/)'

~30% fail. Control: restart_off 24/24 pass. Three sites fire depending on interleaving:

site assertion observed
purge_delete_scenario.rs:992 consumer offset cleared offset returns
purge_delete_scenario.rs:1006 group offset cleared offset returns
purge_delete_scenario.rs:1331 single segment at offset 0 [0, 5, 10], [0, 5, 10, 15]

Evidence

Restarted node:

.412599  purge-partition reset partition to empty  shard=1 generation=1
.429027  repair prepare received  shard=1 op=1
   ...   ops 2..26
.519273  partition journal repair complete  through_op=26  (commit_min_before=0)

Peer: .428320 served partition repair range from_op=1 to_op=26 served_through=26

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions