Skip to content

Conversation

@jgraettinger
Copy link
Contributor

@jgraettinger jgraettinger commented Jan 6, 2023

This ensures txnRun fails-fast if StartCommit returns an error. If we don't do this, then txnStep will race a select over the shard's readCh with a select of the (failed) OpFuture, and then go on to call ConsumeMessage of a shard which is already in a failing state.


This change is Reviewable

This ensures txnRun fails-fast if StartCommit returns an error.
If we don't do this, then txnStep will race a select over the shard's
`readCh` with a select of the (failed) OpFuture, and then go on to call
ConsumeMessage of a shard which is already in a failing state.
@jgraettinger jgraettinger requested a review from psFried January 6, 2023 20:35
Copy link
Contributor

@psFried psFried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

default:
}

txn.commitBarrier = barrier
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The txn.commitBarrier now won't be set if we're synchronously returning the error. Are all the other accesses of commitBarrier OK with that? Should it clear the previous value? I looked through the file and didn't see any problems, but just wanted to double check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep 👍

@jgraettinger jgraettinger merged commit a2d374c into master Jan 6, 2023
@jgraettinger jgraettinger deleted the johnny/start-commit-error branch January 6, 2023 20:57
psFried added a commit that referenced this pull request Jan 30, 2023
#329 introduced a change to synchronously fail shards if the result of
`store.StartCommit` is immediately available. This is _technically_ a
race condition, since some asynchronous operations may still completed
and observed by `txnStartCommit`. This changes the test to only match
against a portion of the final error message, so that it tolerates the
error being returned either synchronously or asyncronously.
psFried added a commit that referenced this pull request Jan 30, 2023
#329 introduced a change to synchronously fail shards if the result of
`store.StartCommit` is immediately available. This is _technically_ a
race condition, since some asynchronous operations may still completed
and observed by `txnStartCommit`. This changes the test to only match
against a portion of the final error message, so that it tolerates the
error being returned either synchronously or asyncronously.
psFried added a commit that referenced this pull request Feb 27, 2023
#329 introduced a change to synchronously fail shards if the result of
`store.StartCommit` is immediately available. This is _technically_ a
race condition, since some asynchronous operations may still completed
and observed by `txnStartCommit`. This changes the test to only match
against a portion of the final error message, so that it tolerates the
error being returned either synchronously or asyncronously.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants