cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.15k stars 3.81k forks source link

kv: add assertions around inline value and MVCCValueHeaders #131667

Open stevendanna opened 1 month ago

stevendanna commented 1 month ago

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

blathers-crl[bot] commented 1 month ago

Hi @stevendanna, please add branch-* labels to identify which branch(es) this C-bug affects.

:owl: Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.