Skip to content

Commit

Permalink
tests: more strict fix for last_applied_offset check
Browse files Browse the repository at this point in the history
Wait for all victim node records to be applied. If a victim node
contains some of the records that were not applied or about to be
truncated the test should wait before selecting segments to trim as in
the case if segment contains only dirty records removing it will not
cause inconsistency.

Fixes: redpanda-data#8217

Signed-off-by: Michal Maslanka <michal@redpanda.com>
(cherry picked from commit 47a2c05)
  • Loading branch information
mmaslankaprv authored and Michal Maslanka committed Jul 24, 2023
1 parent 2ecccc0 commit 38feb81
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/rptest/tests/controller_erase_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ def wait_all_segments():
bystander_node)["dirty_offset"]

def wait_victim_node_apply_segments():
return admin.get_controller_status(victim_node)[
"last_applied_offset"] >= bystander_node_dirty_offset
status = admin.get_controller_status(victim_node)
last_applied = status["last_applied_offset"]
dirty_offset = status["dirty_offset"]
return dirty_offset == last_applied and last_applied >= bystander_node_dirty_offset

wait_until(
wait_victim_node_apply_segments,
Expand Down

0 comments on commit 38feb81

Please sign in to comment.