Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rptest: fix hwm computation in topic_recovery_test #16764

Merged
merged 1 commit into from
Feb 28, 2024

Conversation

andrwng
Copy link
Contributor

@andrwng andrwng commented Feb 28, 2024

We were previously validating the HWM with the assumption that non-data records were exactly 1:1 with the number of archival segments. While such an assumption isn't unreasonable, it isn't very future proof.

I ran into a test failure where we the highest_producer_id record included to archival made this condition fail:

AssertionError: Unexpected high watermark 5025 (min expected: 5026, max expected: 5029)

This commit updates the check be more future-proof, simply validating how HWM is computed:

hwm = rp_last_offset + 1 - delta

Fixes #16769

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
  • v23.3.x
  • v23.2.x
  • v23.1.x

Release Notes

  • none

We were previously validating the HWM with the assumption that non-data
records were exactly 1:1 with the number of archival segments. While
such an assumption isn't unreasonable, it isn't very future proof.

I ran into a test failure where we the highest_producer_id record
included to archival made this condition fail:

```
AssertionError: Unexpected high watermark 5025 (min expected: 5026, max expected: 5029)
```

This commit updates the check be more future-proof, simply validating
how HWM is computed:

hwm = rp_last_offset + 1 - delta
Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assumption that non-data records were exactly 1:1 with the number of archival segments. While such an assumption isn't unreasonable

IIUC this assumption isn't reasonable, right? Like there are non-data batches that don't correspond to segment rolls is what we are talking about?

@vbotbuildovich
Copy link
Collaborator

vbotbuildovich commented Feb 28, 2024

@andrwng
Copy link
Contributor Author

andrwng commented Feb 28, 2024

assumption that non-data records were exactly 1:1 with the number of archival segments. While such an assumption isn't unreasonable

IIUC this assumption isn't reasonable, right? Like there are non-data batches that don't correspond to segment rolls is what we are talking about?

More or less, yeah. We were placing an upper bound on the number of non-data batches we could have that was tied to the number of archival add_segments commands. In this case, an extra record came in to replicate the highest_producer_id

Copy link
Member

@dotnwat dotnwat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dope

@dotnwat
Copy link
Member

dotnwat commented Feb 28, 2024

btw, did this resolve a CI failure or something?

@andrwng
Copy link
Contributor Author

andrwng commented Feb 28, 2024

btw, did this resolve a CI failure or something?

Yeah, I just opened #16769, which I hit in another PR but didn't see it on GH

@andrwng andrwng merged commit bb6a83e into redpanda-data:dev Feb 28, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI Failure (unexpected high watermark) in TopicRecoveryTest.topic_recovery_test
3 participants