Additionally wrap WBL replay error#12406
Merged
jesusvazquez merged 5 commits intoprometheus:mainfrom Oct 13, 2023
Merged
Conversation
Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Since we double wrap it, we unwrap it before the wbl repair. Alternative solution is to return a boolean from Head.Init to identify the error source, but that looks less clean and leads to a LOT of refactor. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com>
454076f to
704a1e2
Compare
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
1f1d7de to
f83a4ef
Compare
c08e613 to
5e5ec22
Compare
fionaliao
approved these changes
Oct 13, 2023
Contributor
fionaliao
left a comment
There was a problem hiding this comment.
LGTM, just one small nitpick about using a subtest
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
5e5ec22 to
e34dfe2
Compare
jesusvazquez
approved these changes
Oct 13, 2023
Member
jesusvazquez
left a comment
There was a problem hiding this comment.
I'm approving and merging this.
There is a safetynet provided by the tests TestWBLReplay and TestWBLCorruption + the new test where we check that the error is properly wrapped now.
Thanks @fionaliao for your review.
Sheikh-Abubaker
pushed a commit
to Sheikh-Abubaker/prometheus
that referenced
this pull request
Oct 15, 2023
* Additionally wrap WBL replay error Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com> Co-authored-by: Jesus Vazquez <jesusvzpg@gmail.com> Signed-off-by: Sheikh-Abubaker <sheikhabubaker761@gmail.com>
LeviHarrison
pushed a commit
to LeviHarrison/prometheus
that referenced
this pull request
Oct 15, 2023
* Additionally wrap WBL replay error Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com> Co-authored-by: Jesus Vazquez <jesusvzpg@gmail.com>
LeviHarrison
pushed a commit
to LeviHarrison/prometheus
that referenced
this pull request
Oct 15, 2023
* Additionally wrap WBL replay error Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com> Co-authored-by: Jesus Vazquez <jesusvzpg@gmail.com> Signed-off-by: Levi Harrison <git@leviharrison.dev>
LeviHarrison
pushed a commit
to LeviHarrison/prometheus
that referenced
this pull request
Oct 15, 2023
* Additionally wrap WBL replay error Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com> Co-authored-by: Jesus Vazquez <jesusvzpg@gmail.com> Signed-off-by: Levi Harrison <git@leviharrison.dev>
LeviHarrison
pushed a commit
to LeviHarrison/prometheus
that referenced
this pull request
Oct 15, 2023
* Additionally wrap WBL replay error Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com> Co-authored-by: Jesus Vazquez <jesusvzpg@gmail.com> Signed-off-by: Levi Harrison <git@leviharrison.dev>
LeviHarrison
pushed a commit
to LeviHarrison/prometheus
that referenced
this pull request
Oct 15, 2023
* Additionally wrap WBL replay error Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases. This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly. Signed-off-by: Ganesh Vernekar <ganeshvern@gmail.com> Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com> Co-authored-by: Jesus Vazquez <jesusvzpg@gmail.com> Signed-off-by: Levi Harrison <git@leviharrison.dev>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Although WBL replay is already wrapped with errLoadWbl, there are other errors that can happen during a WBL replay. We should not try to repair WAL in those cases.
This commit additionally wraps the final error in Head.Init again with errLoadWbl so that WBL replay errors can be identified properly.
Since we double wrap it, we unwrap it before the wbl repair.
The PR also adds a unit test corrupting the wbl and checking that the returned error is wrapped.