redpanda
redpanda copied to clipboard
r/tests/raft_fixture: fix raft_node_instance::random_batch_base_offset
Previously it would misbehave if max is in a configuration or ghost batch.
- It expanded its search up to dirty_offset and returned a batch lying entirely above max.
- If it nevertheless failed to find a (non-ghost non-configuration) batch it returned model::offset{} even though there could be some valid batch before where it started to search.
The workaround is to expand search towards smaller offsets if we reached the high end of the range.
This fixes write_at_offset_stm_test
Backports Required
- [ ] none - not a bug fix
- [ ] none - this is a backport
- [ ] none - issue does not exist in previous branches
- [ ] none - papercut/not impactful enough to backport
- [x] v25.1.x
- [x] v24.3.x
- [x] v24.2.x
Release Notes
- none
/ci-repeat 1
/ci-repeat 1
/dt