-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kv: non-transactional batches can be split into sub-batches #46081
Comments
This shouldn't have an effect because we still zero out `config.Ops.Batch` owing to cockroachdb#46081. See also cockroachdb#71236. Release note: None
The snippet above has made it into DistSender, cockroach/pkg/kv/kvclient/kvcoord/dist_sender.go Lines 1240 to 1245 in 3ff62c3
but I just ran into the issue again. The problem is that once we add Just pointing this out; this can't really be fixed. But the snippet above is problematic if we were to start mixing DeleteRangeUsingTombstone with, say, a Put. That would result in a batch that claims to be "transactional" and we'd restart in a txn and then fail, since mvcc range deletions are unsupported in the context of a transaction. So the check is wrong in that sense. Besides this also seems to be a real footgun in the KV API. I think we tend to always assume that batches are atomic, but here it's very clear that they mostly, but not always, are. This subtlety is confusing; ideally batches would opt into being split explicitly, and we would always return an error for batches that don't opt in but could in theory require splitting. We have an Footnotes |
We have marked this issue as stale because it has been inactive for |
Discussed in #46017 (review)
The following diff on top of #46017 finds a kv.Batch committed via kv.DB that has writes with two different timestamps.
Diagnosis by @nvanbenschoten
Found by kvnemesis.
Jira issue: CRDB-5106
The text was updated successfully, but these errors were encountered: