-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
34387: kv: cleanup txn more eagerly r=andreimatei a=andreimatei Before this patch, when a txn got a non-retriable error, its heartbeat loop (if any) was left running until the client sent a rollback. This patch makes the txn cleanup more eager - we do it immediately on receiving the error. Besides seeming sane (why wait for the client when we know what must happen), this also makes the TxnCoordSender state more internally consistent: if a non-retriable error contains an Aborted txn, we now stop the hb loop before that loop has the opportunity to freakout about running with an Aborted txn. It's unclear if non-retriable errors could contain Aborted txns, but see below. This patch also refactors the state update code in an attempt to make it more readable. In #34337 we see a crash due to the fact that a heartbeat is running for a transaction whose proto status is no longer PENDING. It's not entirely clear to me how that can happen since we "clean up the txn" - i.e. stop the hb loop - after commits and roll backs as well on TransactionAbortedErrors, but it's also not very convincing that it can't happen. The thing is that the protocol between the "client" and the "server" wrt communicating txn updates from the server is lax and it's not very clear what kind of responses can carry an Aborted or Committed proto in them. This patch also makes leaf TxnCoordSender nimbler by not using interceptors needed only by roots. Release note: None 34828: roachtest: disable follower_reads test for versions prior to v2.2.0 r=ajwerner a=ajwerner Fixed #34814 Release note: None Co-authored-by: Andrei Matei <[email protected]> Co-authored-by: Andrew Werner <[email protected]>
- Loading branch information
Showing
7 changed files
with
434 additions
and
326 deletions.
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
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
Oops, something went wrong.