-
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: fix a bug with reverse scans, multiple column families, and max keys #92643
Conversation
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.
Oops, sorry about that. Thanks for the fix!
@@ -1482,7 +1482,26 @@ func cmdScan(e *evalCtx) error { | |||
opts.AllowEmpty = true | |||
} | |||
if e.hasArg("wholeRows") { | |||
opts.WholeRowsOfSize = 10 // arbitrary, must be greater than largest column family in tests | |||
for _, c := range e.td.CmdArgs { | |||
if c.Key == "wholeRows" { |
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.
nit: maybe you tried this already, but can't this use e.scanArg()
and fall back to 10 when set to 0?
Either way, the test doc comment should be updated with the new argument.
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)
pkg/storage/mvcc_history_test.go
line 1486 at r1 (raw file):
Previously, erikgrinaker (Erik Grinaker) wrote…
nit: maybe you tried this already, but can't this use
e.scanArg()
and fall back to 10 when set to 0?Either way, the test doc comment should be updated with the new argument.
e.scanArg()
requires that the value is present, but I thought it would be annoying to add the value everywhere.
Where is the doc comment you're referring to? (I couldn't find it.)
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 1 of 3 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @erikgrinaker)
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 3 of 3 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @yuzefovich)
pkg/storage/mvcc_history_test.go
line 1486 at r1 (raw file):
Previously, yuzefovich (Yahor Yuzefovich) wrote…
e.scanArg()
requires that the value is present, but I thought it would be annoying to add the value everywhere.Where is the doc comment you're referring to? (I couldn't find it.)
Looks like wholeRows
isn't documented at all. It should be listed here:
// scan [t=<name>] [ts=<int>[,<int>]] [resolve [status=<txnstatus>]] k=<key> [end=<key>] [inconsistent] [skipLocked] [tombstones] [reverse] [failOnMoreRecent] [localUncertaintyLimit=<int>[,<int>]] [globalUncertaintyLimit=<int>[,<int>]] [max=<max>] [targetbytes=<target>] [allowEmpty] |
…max keys This commit fixes a bug with how we're checking whether the last row has final column family when performing a reverse scan. Previously, we'd incorrectly treat the largest column ID as the "last" one, but with the reverse iteration actually the zeroth column family is the "last" one. As a result, we could return an incomplete row to SQL. However, there is no production impact to this bug because no user at the SQL layer currently satisfies all the conditions: - `WholeRowsOfSize` option must be used. Currently, it is only used by the streamer; - the reverse scan must be requested and `MaxSpanRequestKeys` must be set - neither is currently done by the streamer. Release note: None
82237c6
to
1f7e094
Compare
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.
TFTRs!
bors r+
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @erikgrinaker)
pkg/storage/mvcc_history_test.go
line 1486 at r1 (raw file):
Previously, erikgrinaker (Erik Grinaker) wrote…
Looks like
wholeRows
isn't documented at all. It should be listed here:
// scan [t=<name>] [ts=<int>[,<int>]] [resolve [status=<txnstatus>]] k=<key> [end=<key>] [inconsistent] [skipLocked] [tombstones] [reverse] [failOnMoreRecent] [localUncertaintyLimit=<int>[,<int>]] [globalUncertaintyLimit=<int>[,<int>]] [max=<max>] [targetbytes=<target>] [allowEmpty]
Added.
Build succeeded: |
This commit fixes a bug with how we're checking whether the last row has final column family when performing a reverse scan. Previously, we'd incorrectly treat the largest column ID as the "last" one, but with the reverse iteration actually the zeroth column family is the "last" one. As a result, we could return an incomplete row to SQL.
However, there is no production impact to this bug because no user at the SQL layer currently satisfies all the conditions:
WholeRowsOfSize
option must be used. Currently, it is only used by the streamer;MaxSpanRequestKeys
must be set - neither is currently done by the streamer.Epic: None
Release note: None