-
Notifications
You must be signed in to change notification settings - Fork 472
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
sstable: don't skipBackward past empty blocks with hideObsolete #3785
sstable: don't skipBackward past empty blocks with hideObsolete #3785
Conversation
This really only affects shared foreign sstables because all other use cases of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! Do you understand why it wasn't detected before?
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @itsbilal)
sstable/reader_iter_single_lvl.go
line 1449 at r1 (raw file):
} kv := i.data.Last() if kv == nil {
I don't understand the kv == nil
check at all.. Other than HideObsoletePoints
, is it possible to have empty blocks? And if we do, why would we just stop there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RaduBerinde just cuz it takes disaggregated storage and shared ingestions to trigger this, a specific set of blocks with snapshot-pinned obsolete keys (something that only happens rarely), and sometimes an excise or so.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @RaduBerinde)
sstable/reader_iter_single_lvl.go
line 1449 at r1 (raw file):
Previously, RaduBerinde wrote…
I don't understand the
kv == nil
check at all.. Other thanHideObsoletePoints
, is it possible to have empty blocks? And if we do, why would we just stop there?
I guess I wanted this change to be as incremental as possible. But you're right that in all cases of empty-ish blocks, we should keep going for correctness reasons, but limiting that is an optimization. Should I have us continue
in all cases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @itsbilal)
sstable/reader_iter_single_lvl.go
line 1449 at r1 (raw file):
Previously, itsbilal (Bilal Akhtar) wrote…
I guess I wanted this change to be as incremental as possible. But you're right that in all cases of empty-ish blocks, we should keep going for correctness reasons, but limiting that is an optimization. Should I have us
continue
in all cases?
Yeah, and if hideobsoletepoints is the only case where we think this can happen, adding an invariants
check that HideObsoletePoints
is true
Previously, RaduBerinde wrote…
HideObsoletePoints isn't the only case where this happens, it seems. We test for (and come across) other cases where data blocks are empty if I add a panic here. I think we should unconditionally continue though; it matches skipForward behaviour. I'll make that change here. |
Currently, if we skipBackward in singleLevelIterator and come across a seemingly empty data block, we stop right there. This is not safe if hide obsolete points is true, as the block could have just been obsolete in its entirety. This change makes the iterator continue iterating backward until some other termination condition is exhausted. This matches the behaviour for two-level iterators, as well as for skipForward in single-level iterators. Fixes cockroachdb#3761.
3a0bea1
to
7cce8be
Compare
Previously, itsbilal (Bilal Akhtar) wrote…
Done. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 0 of 3 files reviewed, all discussions resolved
TFTR! |
Currently, if we skipBackward in singleLevelIterator and come across a seemingly empty data block, we stop right there. This is not safe if hide obsolete points is true, as the block could have just been obsolete in its entirety. This change makes the iterator continue iterating backward until some other termination condition is exhausted.
This matches the behaviour for two-level iterators, as well as for skipForward in single-level iterators.
Fixes #3761.