Skip to content

Additionally wrap WBL replay error#12406

Merged
jesusvazquez merged 5 commits intoprometheus:mainfrom
codesome:codesome/fix-ooo-repair
Oct 13, 2023
Merged

Additionally wrap WBL replay error#12406
jesusvazquez merged 5 commits intoprometheus:mainfrom
codesome:codesome/fix-ooo-repair

Conversation

@codesome
Copy link
Copy Markdown
Member

@codesome codesome commented May 29, 2023

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.

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>
@jesusvazquez jesusvazquez force-pushed the codesome/fix-ooo-repair branch from 454076f to 704a1e2 Compare October 13, 2023 09:44
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
@jesusvazquez jesusvazquez force-pushed the codesome/fix-ooo-repair branch 3 times, most recently from 1f1d7de to f83a4ef Compare October 13, 2023 10:49
@jesusvazquez jesusvazquez marked this pull request as ready for review October 13, 2023 10:50
@jesusvazquez jesusvazquez self-requested a review as a code owner October 13, 2023 10:50
@jesusvazquez jesusvazquez force-pushed the codesome/fix-ooo-repair branch 3 times, most recently from c08e613 to 5e5ec22 Compare October 13, 2023 10:56
Copy link
Copy Markdown
Contributor

@fionaliao fionaliao left a comment

Choose a reason for hiding this comment

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

LGTM, just one small nitpick about using a subtest

Signed-off-by: Jesus Vazquez <jesusvzpg@gmail.com>
@jesusvazquez jesusvazquez force-pushed the codesome/fix-ooo-repair branch from 5e5ec22 to e34dfe2 Compare October 13, 2023 11:49
Copy link
Copy Markdown
Member

@jesusvazquez jesusvazquez left a comment

Choose a reason for hiding this comment

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

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.

@jesusvazquez jesusvazquez merged commit f591326 into prometheus:main Oct 13, 2023
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>
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.

3 participants