cockroachdb / cockroachdb/cockroach

storage/pebbleiter: mangle LazyValue buffers

Open
#150,254 1 comment 0 reactions 0 assignees View on GitHub
A-storage C-cleanup T-storage
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The LazyValue interface can be used to retrieve a KV's value after the iterator has already been repositioned. However, when this is done, the LazyValue must have been cloned. Otherwise the data backing the LazyValue may have been invalidated. We use the `pkg/storage/pebbleiter` package to validate proper usage of iterators. We should expand this to validate proper usage of the LazyValue (eg, maybe mangle the returned LazyValue's byte slices when the original iterator is repositioned).

https://github.com/cockroachdb/cockroach/blob/627907ad2ac9749028df9a32ebdc06107c312103/pkg/storage/pebbleiter/crdb_test_on.go#L140-L145

Informs #150216.

Jira issue: CRDB-52622

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.