forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kv: stop the heartbeat loop on rollback errors
A txn's heartbeat loop is generally stopped when, upon a successful request, the response's txn is no longer PENDING. This was insufficient; the loop should always be closed after an EndTransaction(commit=false), regardless of whether it results in success or error. The heartbeat loop happens to be currently closed by the context cancelation that the db.Txn() API performs, but that is going away. This fixes cockroachdb#26434 - TestTxnCoordSenderRetries had become flaky after cockroachdb#25541 because cockroachdb#25441 caused EndTransactions to be sent in some situations where they weren't before. What's going on in that test is that a subtest was leaking a heartbeat loop that was stopped after the subtest finished; the EndTxn sent when the loop finally was being stopped was interfering with a CommandFilter installed by a different subtest. Before cockroachdb#25441, the first subtest was waiting for the heartbeat loop to be done because of its own CommandFilter. However, with cockroachdb#25441, the first subtest's CommandFilter was being satisfied by a different, newly introduced EndTransaction. Release note: None
- Loading branch information
1 parent
ebc9b0d
commit 7f39653
Showing
3 changed files
with
104 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters