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

sstable: fix LazyFetcher lifetime #4137

Merged

Conversation

RaduBerinde
Copy link
Member

In #4123 we switched to allocating the fetcher lazily and restricting
the valueBlockReader lifetime to that of the iterator. However, the
lifetime of the *LazyFetcher stored in the value must outlive the
iterator and it currently lives inside valueBlockReader.

This change fixes the bug by moving the LazyFetcher to
valueBlockFetcher.

Fixes #4131

In cockroachdb#4123 we switched to allocating the fetcher lazily and restricting
the `valueBlockReader` lifetime to that of the iterator. However, the
lifetime of the `*LazyFetcher` stored in the value must outlive the
iterator and it is currently lives inside `valueBlockReader`.

This change fixes the bug by moving the `LazyFetcher` to
`valueBlockFetcher`.

Fixes cockroachdb#4131
@RaduBerinde RaduBerinde requested a review from a team as a code owner November 5, 2024 19:13
@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator

@jbowens jbowens 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! all files reviewed, all discussions resolved (waiting on @sumeerbhola)

@RaduBerinde
Copy link
Member Author

TFTR!

@RaduBerinde RaduBerinde merged commit 2da617a into cockroachdb:master Nov 5, 2024
23 checks passed
@RaduBerinde RaduBerinde deleted the fix-lazy-fetcher-lifetime branch November 5, 2024 21:49
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.

github.com/cockroachdb/pebble/internal/metamorphic: TestMetaTwoInstance failed
3 participants