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

storage: renaming functions in the Reader interface #55998

Merged
merged 1 commit into from
Oct 27, 2020

Conversation

sumeerbhola
Copy link
Collaborator

  • Get to MVCCGet
  • GetProto to MVCCGetProto
  • Iterate to MVCCIterate
  • ExportToSst to ExportMVCCToSst

Also added MVCCIterKind.

Release note: None

@sumeerbhola sumeerbhola requested a review from a team as a code owner October 26, 2020 20:26
@sumeerbhola sumeerbhola requested review from dt and removed request for a team October 26, 2020 20:26
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@dt
Copy link
Member

dt commented Oct 26, 2020

I'm not sure if we care, but ExportToSST isn't quite like the others in that it doesn't always do normal MVCC lastest-as-of-x reads, e.g. if revisions=true. Maybe it is still more MVCC-ish than not though?

Copy link
Collaborator

@petermattis petermattis left a comment

Choose a reason for hiding this comment

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

:lgtm:

I don't have good thoughts on @dt's comment.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @dt, @itsbilal, @nvanbenschoten, @petermattis, and @sumeerbhola)


pkg/storage/engine.go, line 636 at r5 (raw file):

// start (inclusive) and ending at end (non-inclusive).
// Specify max=0 for unbounded scans.
func Scan(reader Reader, start, end roachpb.Key, max int64) ([]MVCCKeyValue, error) {

This function is a bit dangerous, especially with max=0. Not for this PR, but I wonder if we should get rid of it. There are only 4 uses.

Copy link
Collaborator Author

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

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

TFTRs!

I'm not sure if we care, but ExportToSST isn't quite like the others in that it doesn't always do normal MVCC lastest-as-of-x reads, e.g. if revisions=true. Maybe it is still more MVCC-ish than not though?

The use of "MVCC" in the naming here is saying that we are iterating over the part of the key space that can have multiple versions. Whether the caller is only interested in the latest version, or all, is orthogonal to this naming.

This is to distinguish it from iterating over the more general EngineKey key space which would include MVCC and lock table.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @dt, @itsbilal, @nvanbenschoten, and @petermattis)


pkg/storage/engine.go, line 636 at r5 (raw file):

Previously, petermattis (Peter Mattis) wrote…

This function is a bit dangerous, especially with max=0. Not for this PR, but I wonder if we should get rid of it. There are only 4 uses.

There are a lot of test uses (I see more than 20).

@dt dt removed their request for review October 26, 2020 23:01
- Get to MVCCGet
- GetProto to MVCCGetProto
- Iterate to MVCCIterate
- ExportToSst to ExportMVCCToSst

Also added MVCCIterKind.

Release note: None
@sumeerbhola
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 27, 2020

Build succeeded:

@craig craig bot merged commit 5e3c201 into cockroachdb:master Oct 27, 2020
@sumeerbhola sumeerbhola deleted the reader_refactor branch November 2, 2020 12:16
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.

4 participants