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

Issue #2908: Replace unsafe NoEntryException with IOException #2909

Merged
merged 2 commits into from Aug 1, 2022

Conversation

Vanlightly
Copy link
Contributor

Motivation

Throwing a NoEntryException from the entry logger
for an entry that the index says should exist is
unsafe. It can cause ledger truncation during ledger
recovery. It only takes a single false NoSuchEntry
response to trigger truncation.

NoEntryException should only be thrown from inside
ledger storage if the entry is not found in the index.

Changes

Do not throw NoEntryException from EntryLogger on failing to read entry from log file, throw IOException instead.

Master Issue: #2908

Copy link
Contributor

@StevenLuMT StevenLuMT left a comment

Choose a reason for hiding this comment

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

lgtm

@hangc0276
Copy link
Contributor

ping @Vanlightly, Would you please rebase the master? thanks.

@hangc0276
Copy link
Contributor

ping @merlimat @eolivelli, Would you please help take a look? thanks a lot.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@eolivelli
Copy link
Contributor

LGTM

@zymap
Copy link
Member

zymap commented Jul 29, 2022

I just want to merge master branch into this, found that introduces some unnecessary commits. So I revert it.

@zymap
Copy link
Member

zymap commented Jul 29, 2022

Rebase is easier than merge master, but that needs to force push the first commit. If @Vanlightly won't have time to do that, I would like to help with this PR in the next monday.

Throwing a NoEntryException from the entry logger
for an entry that the index says should exist is
unsafe. It can cause ledger truncation during ledger
recovery. It only takes a single false NoSuchEntry
response to trigger truncation.

NoEntryException should only be thrown from inside
ledger storage if the entry is not found in the index.
@hangc0276 hangc0276 merged commit 966b865 into apache:master Aug 1, 2022
zymap pushed a commit that referenced this pull request Aug 1, 2022
* Replace unsafe NoEntryException with IOException

Throwing a NoEntryException from the entry logger
for an entry that the index says should exist is
unsafe. It can cause ledger truncation during ledger
recovery. It only takes a single false NoSuchEntry
response to trigger truncation.

NoEntryException should only be thrown from inside
ledger storage if the entry is not found in the index.

* fix CI

Co-authored-by: chenhang <chenhang@apache.org>
(cherry picked from commit 966b865)
hangc0276 pushed a commit to hangc0276/bookkeeper that referenced this pull request Nov 7, 2022
…pache#2909)

* Replace unsafe NoEntryException with IOException

Throwing a NoEntryException from the entry logger
for an entry that the index says should exist is
unsafe. It can cause ledger truncation during ledger
recovery. It only takes a single false NoSuchEntry
response to trigger truncation.

NoEntryException should only be thrown from inside
ledger storage if the entry is not found in the index.

* fix CI

Co-authored-by: chenhang <chenhang@apache.org>
(cherry picked from commit 966b865)
hangc0276 pushed a commit to hangc0276/bookkeeper that referenced this pull request Nov 7, 2022
…pache#2909)

* Replace unsafe NoEntryException with IOException

Throwing a NoEntryException from the entry logger
for an entry that the index says should exist is
unsafe. It can cause ledger truncation during ledger
recovery. It only takes a single false NoSuchEntry
response to trigger truncation.

NoEntryException should only be thrown from inside
ledger storage if the entry is not found in the index.

* fix CI

Co-authored-by: chenhang <chenhang@apache.org>
(cherry picked from commit 966b865)
nicoloboschi pushed a commit to datastax/bookkeeper that referenced this pull request Jan 11, 2023
…pache#2909)

* Replace unsafe NoEntryException with IOException

Throwing a NoEntryException from the entry logger
for an entry that the index says should exist is
unsafe. It can cause ledger truncation during ledger
recovery. It only takes a single false NoSuchEntry
response to trigger truncation.

NoEntryException should only be thrown from inside
ledger storage if the entry is not found in the index.

* fix CI

Co-authored-by: chenhang <chenhang@apache.org>
(cherry picked from commit 966b865)
(cherry picked from commit 23355e0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants