cockroachdb / cockroachdb/cockroach

kv: add assertions around inline value and MVCCValueHeaders

Open
#131,667 1 comment 0 reactions 0 assignees View on GitHub
branch-master C-bug T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Describe the problem**

Currently, it is difficult to write an inline value that would also include an MVCCValueHeader. In fact, a caller of the KV APIs would have to go substantially out of their way to produce such a value.

As we include more features that require reading MVCCValueHeader values, it would be nice if we could be sure that inline values do not need to be handled in such cases.

Towards this end, we should:

1. Add a test-only assertion in the inline write path that values aren't using the extended encoding.
2. Add a test-only assertion in the read path that we don't encounter extended encoding. It's unclear to me whether we'll need changes to the kvnemesis code to do this.
3. Add some tests that hit these assertions.

Jira issue: CRDB-42648

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.