-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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: Refactor resolve write intent options #94764
storage: Refactor resolve write intent options #94764
Conversation
Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. I have added a few people who may be able to assist in reviewing:
🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
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.
👋 thanks!
Reviewed 16 of 16 files at r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker and @KaiSun314)
pkg/storage/mvcc.go
line 4811 at r1 (raw file):
if opts.MaxKeys < 0 { resumeSpan := intent.Span // don't inline or `intent` would escape to heap return 0, 0, &resumeSpan, roachpb.RESUME_UNKNOWN, nil
nit: It's slightly more idiomatic to return 0
instead of roachpb.RESUME_UNKNOWN
in these cases, because the zero value of the enum is usable.
pkg/storage/mvcc.go
line 4857 at r1 (raw file):
if opts.MaxKeys > 0 && numKeys == opts.MaxKeys { // We could also compute a tighter nextKey here if we wanted to. return numKeys, 0, &roachpb.Span{Key: lastResolvedKey.Next(), EndKey: intentEndKey}, roachpb.RESUME_UNKNOWN, nil
Should this be RESUME_KEY_LIMIT
?
f2f6c10
to
dca422f
Compare
Thank you for updating your pull request. My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
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: complete! 0 of 0 LGTMs obtained (waiting on @erikgrinaker and @nvanbenschoten)
pkg/storage/mvcc.go
line 4857 at r1 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Should this be
RESUME_KEY_LIMIT
?
I was thinking in this PR, I would always return 0 for the resumeReason and comment that resumeReason is currently unused (to ensure this PR is purely refactoring). In the next PR that adds byte pagination, I will return the appropriate RESUME_KEY_LIMIT
/ RESUME_BYTE_LIMIT
.
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.
Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker and @KaiSun314)
pkg/storage/mvcc.go
line 4857 at r1 (raw file):
Previously, KaiSun314 (Kai Sun) wrote…
I was thinking in this PR, I would always return 0 for the resumeReason and comment that resumeReason is currently unused (to ensure this PR is purely refactoring). In the next PR that adds byte pagination, I will return the appropriate
RESUME_KEY_LIMIT
/RESUME_BYTE_LIMIT
.
I slightly prefer returning RESUME_KEY_LIMIT
here, because that's the resume reason. Each PR should stand on its own, and this one is arguably incorrect if it doesn't report the correct resume reason. Put another way, if we don't want to return a resume reason in this PR, it shouldn't be part of the function signature at all yet.
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 did a quick read -- nothing to add beyond @nvanbenschoten's existing comment.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker and @KaiSun314)
In this PR, we add MVCCResolveWriteIntentOptions to MVCCResolveWriteIntent and MVCCResolveWriteIntentRangeOptions to MVCCResolveWriteIntentRange. Moreover, we additionally return numBytes and resumeSpan in MVCCResolveWriteIntent and numBytes and resumeReason in MVCCResolveWriteIntentRange, but these return values are currently unused and serve as a placeholder in refactoring, but will be used in the future. Informs: cockroachdb#77228 Release note: None
dca422f
to
aa3e37c
Compare
Thank you so much for the review Nathan and Sumeer! bors r=nvanbenschoten, sumeerbhola |
🔒 Permission denied Existing reviewers: click here to make KaiSun314 a reviewer |
bors r+ |
This PR was included in a batch that successfully built, but then failed to merge into master. It will not be retried. Additional information: |
Bors is pretty messed up atm. Let's try again tomorrow. |
Let's try this again. bors r+ single on |
Build succeeded: |
In this PR, we add MVCCResolveWriteIntentOptions to MVCCResolveWriteIntent and MVCCResolveWriteIntentRangeOptions to MVCCResolveWriteIntentRange. Moreover, we additionally return numBytes and resumeSpan in MVCCResolveWriteIntent and numBytes and resumeReason in MVCCResolveWriteIntentRange, but these return values are currently unused and serve as a placeholder in refactoring, but will be used in the future.
Informs: #77228
Release note: None