kvserver: clean up after EndTxn even if client disconnects #64770
Labels
A-kv-transactions
Relating to MVCC and the transactional model.
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
The main transaction cleanup (record and intents) is done after the Raft entry has been applied:
cockroach/pkg/kv/kvserver/replica_write.go
Lines 222 to 228 in c81a2a3
However, if the client context is cancelled during Raft processing, we skip this cleanup:
cockroach/pkg/kv/kvserver/replica_write.go
Lines 291 to 297 in c81a2a3
We should try to do this cleanup even when the context is cancelled.
As noted in #60585 (comment), this problem is exacerbated by rollbacks following client disconnects during in-flight txns or DML statements getting a 3-second context timeout -- if the request doesn't make it through RPC and Raft in that time, it won't be cleaned up.
The text was updated successfully, but these errors were encountered: