-
Notifications
You must be signed in to change notification settings - Fork 3.9k
kv: check for 1-phase commit after request, not before #41104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kv: check for 1-phase commit after request, not before #41104
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I stared at this a bunch but still not sure I got it right. The previous code counted 1PC attempts instead of successes? I know that DistSender will prevent 1PC when the epoch is not zero any more. Are you saying that without that behavior there's starvation? Shouldn't the 1PC attempt at the replica also lay down an intent if it doesn't go through?
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @andreimatei)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Tobi, this PR is strictly for the 1PC metric. Before the patch, we'd count 1pc attempts, with the patch we count 1pc successes.
Nathan, it does appear that that commit message could be improved :P
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @andreimatei)
Found while verifying that cockroachdb#40518 didn't negatively impact YCSB performance. As it turns out, most txns that restart hit the check in DistSender instead, and that ends up being critical for forward progress. Without it, transactions appear to starve because they never write intents. The commit doesn't make any changes there, but it does fix an issue where 1PC transactions were being incorrectly detected. The detection was ignoring the fact that a 1PC attempt could be rejected by DistSender or a Replica. We now tie the metric to whether an EndTransaction actually evaluated as a 1PC txn instead of tying it to whether the EndTransaction _wanted_ to be evaluated as a 1PC txn. Release justification: low risk and improves metric reporting Release note: None
2dc1504
to
2dc5eb8
Compare
Ah yes, you're right. I guess I still had the experiment on my mind and didn't realize I had failed to mention what the PR was actually changing. Updated. |
bors r+ |
41098: roachtest/jepsen: don't fail test if retrieving invoke.log fails r=nvanbenschoten a=nvanbenschoten Fixes #41062. Release justification: Testing only. Release note: None 41104: kv: check for 1-phase commit after request, not before r=nvanbenschoten a=nvanbenschoten Found while verifying that #40518 didn't negatively impact YCSB performance. As it turns out, most txns that restart hit the check in DistSender instead, and that ends up being critical for forward progress. Without it, transactions appear to starve because they never write intents. The commit doesn't make any changes there, but it does fix an issue where 1PC transactions were being incorrectly detected. The detection was ignoring the fact that a 1PC attempt could be rejected by DistSender or a Replica. We now tie the metric to whether an EndTransaction actually evaluated as a 1PC txn instead of tying it to whether the EndTransaction _wanted_ to be evaluated as a 1PC txn. Release justification: low risk and improves metric reporting Release note: None 41127: Add myself to AUTHORS r=miretskiy a=miretskiy Authors += Myself Co-authored-by: Nathan VanBenschoten <[email protected]> Co-authored-by: Yevgeniy Miretskiy <[email protected]>
Build succeeded |
This was no longer true, as of cockroachdb#41104. Release note: None
This was no longer true, as of cockroachdb#41104. Release note: None
Found while verifying that #40518 didn't negatively impact YCSB performance.
As it turns out, most txns that restart hit the check in DistSender instead,
and that ends up being critical for forward progress. Without it, transactions
appear to starve because they never write intents.
The commit doesn't make any changes there, but it does fix an issue where
1PC transactions were being incorrectly detected. The detection was ignoring
the fact that a 1PC attempt could be rejected by DistSender or a Replica.
We now tie the metric to whether an EndTransaction actually evaluated as
a 1PC txn instead of tying it to whether the EndTransaction wanted to
be evaluated as a 1PC txn.
Release justification: low risk and improves metric reporting
Release note: None