cockroachdb / cockroachdb/cockroach

kv: disallow Put/Delete requests after a DeleteRange request in a batch

Open
#144,069 1 comment 0 reactions 1 assignee Claimed by @stevendanna View on GitHub
A-buffered-writes A-kv 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**

@stevendanna pointed me to https://github.com/cockroachdb/cockroach/issues/71236 earlier today. The issue there talks about intents from blind Puts, but I think the hazard also applies to blind Deletes (`DeleteRequests`).

We should validate that once we encounter a `DeleteRange` in a batch, there isn't a subsequent `Put` or `Delete` request after it. This should be fine, as SQL currently doesn't construct batches like such. Moreover, even when flushing the buffer when running with buffered writes, we'll only ever prepend to a batch that has `DeleteRange` requests.

Jira issue: CRDB-49220

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.