You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kv: don't let pusher win when pushing STAGING txn with equal priority
Fixescockroachdb#105330.
Fixescockroachdb#101721.
This commit updates the transaction push logic to stop pushes from completing
successfully when the pushee is STAGING and the pusher has equal priority. Prior
to this change, the pusher would win in these cases when using a PUSH_TIMESTAMP
if at least one of the two transactions involved used a weak isolation level.
This had two undesirable effects:
- if the pushee was still possibly committable and requiring recovery
(`!(knownHigherTimestamp || knownHigherEpoch)` in the code) then the pusher
would immediately begin parallel commit recovery, attempting to disrupt the
commit and abort the pushee. This is undesirable because the pushee may still
be in progress and in cases of equal priority, we'd like to wait for the
parallel commit to complete before kicking off recovery, deferring recovery to
only the cases where the pushee/committers's heartbeat has expired.
- if the pushee was known to be uncommittable (`knownHigherTimestamp || knownHigherEpoch`
in the code), then txn recovery was not kicked off but the pusher still could
not perform the PUSH_TIMESTAMP (see e40c1b4), so it would return a
`TransactionPushError`. This confused logic in `handleTransactionPushError`,
allowing the error to escape to the client.
This commit resolves both issues by considering the pushee's transaction status
in `txnwait.ShouldPushImmediately`.
Release note: None
0 commit comments