apache / apache/iggy

server: partition journal repair resurrects purged data after restart

Open
#3,793 5 comments 0 reactions 1 assignee Claimed by @jphjsoares View on GitHub
bug
Dominant language
Rust
Stars
4.9k
Forks
432
Avg merge
2d 10h
Merged PRs (30d)
173

Description

### 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`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.