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

db: refactor compaction iteration interfaces for deferring value retrieval #4197

Open
jbowens opened this issue Dec 10, 2024 · 0 comments · May be fixed by #4198
Open

db: refactor compaction iteration interfaces for deferring value retrieval #4197

jbowens opened this issue Dec 10, 2024 · 0 comments · May be fixed by #4198

Comments

@jbowens
Copy link
Collaborator

jbowens commented Dec 10, 2024

With #112, we will sometimes copy a blob value reference as-is, without ever retrieving the referenced value. Today the compaction loop and iterator greedily load the value. This issue tracks work to refactor the compaction iterator interfaces to propagate LazyValues and references as necessary.

Jira issue: PEBBLE-313

@jbowens jbowens self-assigned this Dec 10, 2024
jbowens added a commit to jbowens/pebble that referenced this issue Dec 12, 2024
During compaction iteration, defer the retrieval of values stored in value
blocks until either:

a) we need to copy the value before stepping the iterator, or
b) the compaction iterator yields the value to the main compaction loop.

This refactor ensures that when a KV is elided by a tombstone, we avoid
unnecessarily loading its value from the external value block. Additionally,
refactoring the compaction iterator interfaces to propagate LazyValues will be
used by value separation (cockroachdb#112) in which we will sometimes propagate external
value references to output sstables without ever retrieving the value.

Close cockroachdb#4197.
Informs cockroachdb#112.
@jbowens jbowens linked a pull request Dec 12, 2024 that will close this issue
jbowens added a commit to jbowens/pebble that referenced this issue Dec 12, 2024
During compaction iteration, defer the retrieval of values stored in value
blocks until either:

a) we need to copy the value before stepping the iterator, or
b) the compaction iterator yields the value to the main compaction loop.

This refactor ensures that when a KV is elided by a tombstone, we avoid
unnecessarily loading its value from the external value block. Additionally,
refactoring the compaction iterator interfaces to propagate LazyValues will be
used by value separation (cockroachdb#112) in which we will sometimes propagate external
value references to output sstables without ever retrieving the value.

Close cockroachdb#4197.
Informs cockroachdb#112.
jbowens added a commit to jbowens/pebble that referenced this issue Dec 13, 2024
During compaction iteration, defer the retrieval of values stored in value
blocks until either:

a) we need to copy the value before stepping the iterator, or
b) the compaction iterator yields the value to the main compaction loop.

This refactor ensures that when a KV is elided by a tombstone, we avoid
unnecessarily loading its value from the external value block. Additionally,
refactoring the compaction iterator interfaces to propagate LazyValues will be
used by value separation (cockroachdb#112) in which we will sometimes propagate external
value references to output sstables without ever retrieving the value.

Close cockroachdb#4197.
Informs cockroachdb#112.
jbowens added a commit to jbowens/pebble that referenced this issue Dec 13, 2024
During compaction iteration, defer the retrieval of values stored in value
blocks until either:

a) we need to copy the value before stepping the iterator, or
b) the compaction iterator yields the value to the main compaction loop.

This refactor ensures that when a KV is elided by a tombstone, we avoid
unnecessarily loading its value from the external value block. Additionally,
refactoring the compaction iterator interfaces to propagate LazyValues will be
used by value separation (cockroachdb#112) in which we will sometimes propagate external
value references to output sstables without ever retrieving the value.

Close cockroachdb#4197.
Informs cockroachdb#112.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Incoming
Development

Successfully merging a pull request may close this issue.

1 participant