kvserver: sync txn record cleanup can be cancelled prematurely #64868
Labels
A-kv-transactions
Relating to MVCC and the transactional model.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
As described in #60585 (comment), when
IntentResolver.CleanupTxnIntentsAsync()
is called withallowSyncProcessing=true
, the cleanup task can be run synchronously and using the caller's context. However, this cleanup task spawns off another async task to clean up the transaction record:cockroach/pkg/kv/kvserver/intentresolver/intent_resolver.go
Lines 757 to 762 in a4b7a43
In the synchronous case, this cleanup task will be connected to the caller's context, but runs async. As such, the call will likely return to the caller before
gcTxnRecord()
completes, and the caller may the cancel the context (due to e.g.defer cancel()
or disconnection) which will cancelgcTxnRecord()
as well.The text was updated successfully, but these errors were encountered: