almostintuitive opened a new pull request, #4295:
URL: https://github.com/apache/iggy/pull/4295
## Which issue does this PR address?
Relates to ##4294
## Rationale
The maintainers asked that a new bug come with a failing test. This PR adds
only
that test. The fix is still open for discussion, so it isn't included.
## What changed?
A newly elected metadata primary can panic with
`on_ack: committed prepare op=N ... must be in journal`. `tick_metadata`'s
walk-stall detector treats the op that the pipeline holds as a header
without a
body. `commit_journal` intentionally stops at the pipeline head, and the
detector then truncates that op from the WAL. The next commit driver finds it
missing and panics.
`metadata_walk_stuck_detector_tests` reproduces this in the simulator with a
fixed swarm seed, three `Register` ops, two crashes and one restart, and no
other traffic. After the drain, it asserts that every replica has applied the
three registrations. It fails today with the panic above. A `TODO(#4294)`
comment in `metadata_gap_probe` (shard crate) marks where the fix belongs and
suggests the fix: exclude `pipeline_head_header().op == commit_min + 1` from
`next_op_resident`.
The test is deliberately **not** `#[ignore]`d, because the maintainers asked
for
a failing test. That makes this PR red on CI until the fix lands. If you'd
rather
keep master green, it can take the `#[ignore = "#4294: ..."]` form used for
the
other known-open simulator cases.
## Local Execution
- Not passed: the new test fails as intended, with the panic shown in the
issue.
With the one-line fix from the TODO applied, which isn't part of this PR,
it
passes. `cargo fmt --all --check` and
`cargo clippy -p simulator -p shard --tests -- -D warnings` are clean.
- Pre-commit hooks: not run (prek not installed in the environment used)
## AI Usage
1. Claude (Claude Code).
2. Root-cause investigation, the test and the write-up.
3. The test was run locally, and it fails with the panic shown in the issue.
The
mechanism was confirmed with tracing (a `resident header with no body`
truncation right before the panic, with no `prepare body missing`
warning),
and with a counter-experiment: the suggested fix makes the test pass and
clears the seeds that had reproduced the panic. Neither the tracing nor
the
fix is part of this PR.
4. Yes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]