cockroachdb / cockroachdb/cockroach
storage/pebbleiter: mangle LazyValue buffers
- 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
Assessment
This issue has not been assessed yet.