storage/engine: fix pebbleBatch.iter reuse#41896
Merged
petermattis merged 1 commit intocockroachdb:masterfrom Oct 24, 2019
Merged
storage/engine: fix pebbleBatch.iter reuse#41896petermattis merged 1 commit intocockroachdb:masterfrom
petermattis merged 1 commit intocockroachdb:masterfrom
Conversation
Member
Collaborator
Author
|
Hrmm, this is still broken. Now in a different way. Hold off on reviewing. |
`pebbleBatch.NewIterator` was setting `pebbleBatch.iter.inuse = true`, and then calling `pebbleIterator.init` which was clearing that field. This was broken by cockroachdb#41859 which refactored how `pebbleBatch` iterator reuse works. Added separate cached prefix and normal iterators to `pebble{Batch,ReadOnly}`. Various bits of higher-level code expect to be able to have a prefix and normal iterator open at the same time. In particularly, this comes up during intent resolution. This also mimics our usage of RocksDB which seems desirable in the short term even though the semantics of having two cached iterators is slightly odd. Fixes cockroachdb#41899
09131bf to
550d483
Compare
petermattis
commented
Oct 24, 2019
Collaborator
Author
petermattis
left a comment
There was a problem hiding this comment.
Ok, all fixed up. This is ready for a look.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @itsbilal and @sumeerbhola)
pkg/storage/engine/pebble_batch.go, line 27 at r1 (raw file):
buf []byte prefixIter pebbleIterator normalIter pebbleIterator
@itsbilal I had to go ahead and do this because TestMVCCOpLogWriter/pebble was failing.
itsbilal
approved these changes
Oct 24, 2019
Contributor
itsbilal
left a comment
There was a problem hiding this comment.
Reviewed 4 of 4 files at r1.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @petermattis and @sumeerbhola)
pkg/storage/engine/pebble_batch.go, line 27 at r1 (raw file):
Previously, petermattis (Peter Mattis) wrote…
@itsbilal I had to go ahead and do this because
TestMVCCOpLogWriter/pebblewas failing.
Sounds good, thanks for doing this!
Collaborator
Author
|
TFTR! |
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.
pebbleBatch.NewIteratorwas settingpebbleBatch.iter.inuse = true,and then calling
pebbleIterator.initwhich was clearing thatfield. This was broken by #41859 which refactored how
pebbleBatchiterator reuse works.
Fixes #41899