-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
Replica Batch ground work #2340
Conversation
the changes up to and including my 5th commit fix intent the push batch in |
898ca66
to
7a9722d
Compare
the |
@@ -462,11 +462,14 @@ message PushTxnResponse { | |||
} | |||
|
|||
// A ResolveIntentRequest is arguments to the ResolveIntent() | |||
// method. It is sent by transaction coordinators and after success | |||
// method. It is esnt by transaction coordinators and after success |
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.
oops
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.
done.
7a9722d
to
5e3c301
Compare
cherry-picked @thundercw's open PR #2345 and voila, green build. |
15c9632
to
d47b3a3
Compare
ok, so once #2345 lands I think this is actually in good shape to be merged. It needs some rounding around the edges (specifically self-overlap) but that's better solved in follow-up work. So, please review. |
@tamird I've assigned you since @spencerkimball is out and you've already taken a look. Feel free to re-assign to someone else, though. |
if body.Less(proto.KeyMax) { | ||
return nil | ||
if proto.KeyMax.Less(body) { | ||
return NewInvalidRangeMetaKeyError("body of meta2 range lookup is > KeyMax", key) |
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.
s/>/>=/
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.
ping @thundercw (this is cherry-picked from #2345)
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.
sorry, didn't read this right the first time. This is actually comparing for >
(note that the old code returned nil
if the condition matched)
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.
isn't it comparing for >=
since that's the inverse of Less
? the old code looks correct with respect to the comment
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.
code above: if KeyMax < key { error }
, so > KeyMax
errors.
old code: if key < KeyMax { no error } else { error }
(so everything >=KeyMax
errors).
This isn't just refactor, there's an actual change. KeyMax
is now valid (at least in this bit of code).
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.
Duh, you're right. carry on!
e182955
to
dc6cc7b
Compare
@tamird: thanks for the review. I think I've addressed it all (see last commit for the diff). |
still going to kill some pointer receivers, actually. |
dc6cc7b
to
ea508ac
Compare
I'm going to wait for #2345 to get ready, update the cherry pick, squash a little bit and then merge. |
ea508ac
to
49cb648
Compare
@@ -472,6 +472,9 @@ message PushTxnResponse { | |||
// commit them. | |||
message ResolveIntentRequest { | |||
optional RequestHeader header = 1 [(gogoproto.nullable) = false, (gogoproto.embed) = true]; | |||
// The transaction whose intent is being pushed. The transaction must either |
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.
s/pushed/resolved/
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.
actually just realized that the comment here is wrong. The Txn can of course be PENDING
if a txn has been pushed forward in time. Updating.
LGTM |
}() | ||
|
||
// Remove keys from command queue. | ||
r.endCmds(cmdKeys, bArgs, err) |
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.
@tschottdorf I think the contentions scope above can be avoided by putting this in a defer
. WDYT?
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 just went ahead and removed the outer scoping. I think that's clear enough and not error prone in this case.
809374a
to
1e53690
Compare
* feedback on original diff * rebase fixups * fix data race * add missing timestamp on BatchRequest header this is cleaned up more in #2141, where only the batch gets the headers, but with this fix we avoid one obvious source of them. * 5 instead of 50k intents in TestGCQueueIntentResolution ain't nobody got time for that (now). * do not verifyKeys() if it is a batch batch semantics can go either way. Cleaned up more in #2141, where keys on the batch header are always a key range (and subject to removal, see #2155). * deal with batch self-overlap in command queue even basic tests have this (TestUpdateRangeAddressing by the way) and however we deal with this, it should be on Store. * allow self-overlapping batches discussion needed, but if this has a good chance of leading to passing tests, I think we should go down that route first. * make RaftCmd.Cmd nullable * panic on empty batch * feedback
1e53690
to
c42426a
Compare
thanks for reviewing @tamird @bdarnell. #2345 just landed and I'm going to merge this on green. I quashed my work into @spencerkimball's so that we don't end up with a broken history (most changes are small anyway and I amended his message). |
opening this as a PR so that we can comment and discuss on the diffs. I rebased on top of master and am adding commits, nothing else. Original branch is backed up here.