-
Notifications
You must be signed in to change notification settings - Fork 4k
storage: clarify consistency as of when #158165
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -594,6 +594,7 @@ type Reader interface { | |
| visitSharedFile func(sst *pebble.SharedSSTMeta) error, | ||
| visitExternalFile func(sst *pebble.ExternalFile) error, | ||
| ) error | ||
|
|
||
| // ConsistentIterators returns true if the Reader implementation guarantees | ||
| // that the different iterators constructed by this Reader will see the same | ||
| // underlying Engine state. This is not true about Batch writes: new iterators | ||
|
|
@@ -963,6 +964,11 @@ type Engine interface { | |
| // All iterators created from a read-only engine are guaranteed to provide a | ||
| // consistent snapshot of the underlying engine. See the comment on the | ||
| // Reader interface and the Reader.ConsistentIterators method. | ||
| // | ||
| // NB: consistent iterators are not as of when NewReader is called. They are | ||
| // as of the time when the first iterator is created (often, this is when the | ||
| // first read happens if iterators are not used directly), or earlier if | ||
| // Reader.PinEngineStateForIterators is called. | ||
| NewReader(durability DurabilityRequirement) Reader | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any other places to call this out?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We have many methods that give us a Reader: NewBatch, NewReader, NewReadOnly, NewUnindexedBatch. |
||
| // NewReadOnly returns a new instance of a ReadWriter that wraps this | ||
| // engine, and with the given durability requirement. This wrapper panics | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Looking for suggestion on how to word this. Iterators are always used, but I mean to say that they are often hidden behind things (e.g.
MVCCGet), so it can be the "first read/access" from thestoragepackage user's perspective.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.
I think we can leave it as the simple "when the first iterator is created, or earlier is Reader.PinEngineStateForIterators ...".
Code readers are expected to know that passing a
Readerto some function could cause it to create an iterator.