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

kvclient: fix small bug in txnWriteBuffer #143304

Merged
merged 1 commit into from
Mar 24, 2025

Conversation

stevendanna
Copy link
Collaborator

Previously, we were not resetting the endKey before starting our iteration. This could result in the iterator ending before reaching our desired key despite it being in the buffer.

Epic: none
Release note: None

@stevendanna stevendanna requested a review from a team as a code owner March 21, 2025 20:28
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

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

Nice find! I have a suggestion but :lgtm:

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


pkg/kv/kvclient/kvcoord/txn_interceptor_write_buffer.go line 514 at r1 (raw file):

) (*roachpb.Value, bool) {
	it := twb.buffer.MakeIter()
	seek := &twb.bufferSeek

I think we might need to do the same in addToBuffer, no? Should we extract a helper method that would return "buffer seek" set to appropriate start key and - if applicable - end key? I.e. let's centralize the mutation of reused bufferSeek struct.

Previously, we were not resetting the endKey before starting our
iteration. This could result in the iterator ending before reaching
our desired key despite it being in the buffer.

Epic: none
Release note: None
@stevendanna stevendanna force-pushed the ssd/write-buffer-smol-bug branch from 8ac3b5d to 7c03dcf Compare March 21, 2025 20:48
@stevendanna
Copy link
Collaborator Author

bors r=yuzefovich

@craig craig bot merged commit d59016c into cockroachdb:master Mar 24, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants