redpanda icon indicating copy to clipboard operation
redpanda copied to clipboard

r/tests/raft_fixture: fix raft_node_instance::random_batch_base_offset

Open bashtanov opened this issue 7 months ago • 2 comments

Previously it would misbehave if max is in a configuration or ghost batch.

  1. It expanded its search up to dirty_offset and returned a batch lying entirely above max.
  2. 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

bashtanov avatar Jun 04 '25 14:06 bashtanov

/ci-repeat 1

bashtanov avatar Jun 06 '25 13:06 bashtanov

/ci-repeat 1

bashtanov avatar Jun 09 '25 07:06 bashtanov

/dt

bharathv avatar Jul 03 '25 21:07 bharathv