Skip to content

sql: fix iteration conditions in crdb_internal.scan#98329

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
stevendanna:crdb-internal-scan-bug-fix
Mar 9, 2023
Merged

sql: fix iteration conditions in crdb_internal.scan#98329
craig[bot] merged 1 commit intocockroachdb:masterfrom
stevendanna:crdb-internal-scan-bug-fix

Conversation

@stevendanna
Copy link
Copy Markdown
Collaborator

Rather than using the Next() key of the last key in the response when iterating, we should use the resume span. The previous code could result in a failure in the rare case that the end key of our scan exactly matched the successor key of the very last key in the iteration.

Epic: none

Release note: None

@stevendanna stevendanna requested a review from a team March 9, 2023 19:49
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Rather than using the Next() key of the last key in the response when
iterating, we should use the resume span. The previous code could
result in a failure in the rare case that the end key of our scan
exactly matched the successor key of the very last key in the
iteration.

Release note: None
@stevendanna stevendanna force-pushed the crdb-internal-scan-bug-fix branch from 5919a60 to 15df935 Compare March 9, 2023 19:50
@stevendanna stevendanna requested a review from ajwerner March 9, 2023 19:54
Copy link
Copy Markdown
Contributor

@ajwerner ajwerner left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @stevendanna)

@stevendanna
Copy link
Copy Markdown
Collaborator Author

bors r=ajwerner

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 9, 2023

Build succeeded:

@craig craig bot merged commit 62eb4b8 into cockroachdb:master Mar 9, 2023
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.

3 participants