-
Notifications
You must be signed in to change notification settings - Fork 4k
storage: override MVCCMetadata.TxnDidNotUpdateMeta in mixed version c… #70267
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
Conversation
899b9aa to
6b2e8ac
Compare
6b2e8ac to
10e6f72
Compare
|
@tbg @nvanbenschoten reminder to take a look, since this is potentially a release blocker. |
tbg
left a 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.
Apologies for the delay, I should have looked at this much sooner.
Reviewed 16 of 16 files at r1, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @nicktrav, @nvanbenschoten, and @sumeerbhola)
pkg/storage/mvcc.go, line 1103 at r1 (raw file):
// PutIntent. // // Note that all nodes in this cluster understand separated intents, so can
Could you give this comment another pass? I think it is a bit confusing to read. Here are some ideas
Note that separated intents are understood by v21.1 already, though we assume they were never actively used there (the cluster setting is experimental, and there are known bugs). When migrating into 21.2 however, if 21.2
pkg/storage/testdata/mvcc_histories/conditional_put_with_txn_enable_separated_mixed_cluster, line 16 at r1 (raw file):
>> at end: txn: "A" meta={id=00000000 key=/Min pri=0.00000000 epo=0 ts=123.000000000,0 min=0,0 seq=1} lock=true stat=PENDING rts=123.000000000,0 wto=false gul=0,0 meta: "k"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=123.000000000,0 min=0,0 seq=1} ts=123.000000000,0 del=false klen=12 vlen=6 mergeTs=<nil> txnDidNotUpdateMeta=false
the txnDidNotUpdateMeta=false is the important bit, right? Mind adding this in a comment.
pkg/storage/testdata/mvcc_histories/intent_history_enable_separated_mixed_cluster, line 31 at r1 (raw file):
>> put v=first k=a t=A called PutIntent("a", _, NoExistingIntent, TDNUM(true), 00000000-0000-0000-0000-000000000002) meta: "a"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=2.000000000,0 min=0,0 seq=0} ts=2.000000000,0 del=false klen=12 vlen=10 mergeTs=<nil> txnDidNotUpdateMeta=false
ditto
pkg/storage/testdata/mvcc_histories/intent_with_write_tracing_enable_separated_mixed_cluster, line 10 at r1 (raw file):
>> put k=k1 v=v1 t=A called PutIntent("k1", _, NoExistingIntent, TDNUM(true), 00000000-0000-0000-0000-000000000001) meta: "k1"/0,0 -> txn={id=00000000 key=/Min pri=0.00000000 epo=0 ts=2.000000000,0 min=0,0 seq=0} ts=2.000000000,0 del=false klen=12 vlen=7 mergeTs=<nil> txnDidNotUpdateMeta=false
ditto
pkg/storage/testdata/mvcc_histories/no_read_after_abort_enable_separated_mixed_cluster, line 14 at r1 (raw file):
>> put v=cde t=A k=a called PutIntent("a", _, NoExistingIntent, TDNUM(true), 00000000-0000-0000-0000-000000000001) meta: "a"/0,0 -> txn={id=00000000 key="a" pri=0.00000000 epo=0 ts=22.000000000,0 min=0,0 seq=0} ts=22.000000000,0 del=false klen=12 vlen=8 mergeTs=<nil> txnDidNotUpdateMeta=false
ditto (here and all the other files). Maybe a header in all of these separated_mixed files explaning that the absence of txnDidNotUpdateMeta=true is the important bit.
tbg
left a 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.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @nicktrav, @nvanbenschoten, and @sumeerbhola)
pkg/storage/mvcc.go, line 1130 at r1 (raw file):
} func (t txnDidNotUpdateMetaHelper) valueForPutIntent() bool {
If the cluster version isn't active yet, this is always going to return false, right? Because a true value would have to be emitted from populateMeta at some point in the past, and that is impossible, right? Just checking my understanding.
10e6f72 to
7054431
Compare
sumeerbhola
left a 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.
no problem, and thanks for the review!
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @nicktrav, @nvanbenschoten, and @tbg)
pkg/storage/mvcc.go, line 1103 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
Could you give this comment another pass? I think it is a bit confusing to read. Here are some ideas
Note that separated intents are understood by v21.1 already, though we assume they were never actively used there (the cluster setting is experimental, and there are known bugs). When migrating into 21.2 however, if 21.2
Updated. I've repeated some of the comment from Writer.OverrideTxnDidNotUpdateMetaToFalse to make this more self contained.
pkg/storage/mvcc.go, line 1130 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
If the cluster version isn't active yet, this is always going to return false, right? Because a true value would have to be emitted from
populateMetaat some point in the past, and that is impossible, right? Just checking my understanding.
It can be true if a v21.1 set it to to true, but that is harmless because of the limited way it is used in PutIntent. I've expanded the comment.
pkg/storage/testdata/mvcc_histories/conditional_put_with_txn_enable_separated_mixed_cluster, line 16 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
the
txnDidNotUpdateMeta=falseis the important bit, right? Mind adding this in a comment.
Done for all these tests.
pkg/storage/testdata/mvcc_histories/intent_history_enable_separated_mixed_cluster, line 31 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
ditto
Done
pkg/storage/testdata/mvcc_histories/intent_with_write_tracing_enable_separated_mixed_cluster, line 10 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
ditto
Done
pkg/storage/testdata/mvcc_histories/no_read_after_abort_enable_separated_mixed_cluster, line 14 at r1 (raw file):
Previously, tbg (Tobias Grieger) wrote…
ditto (here and all the other files). Maybe a header in all of these separated_mixed files explaning that the absence of txnDidNotUpdateMeta=true is the important bit.
Done
tbg
left a 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.
Reviewed 6 of 6 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @nicktrav, and @nvanbenschoten)
|
bors r+ |
|
Build failed: |
…luster Specifically, if the cluster version indicates that there can be nodes with the broken SingleDelete logic for separated intent resolution, the MVCCMetadata.TxnDidNotUpdateMeta field will never be set to true. See code comments and cockroachdb#69891 (comment) Informs cockroachdb#69891 Release justification: fix for a release blocker that causes incorrect behavior for transactional writes. Release note: None
|
|
7054431 to
ad320f0
Compare
|
bors r+ |
|
Build succeeded: |
…luster
Specifically, if the cluster version indicates that there can
be nodes with the broken SingleDelete logic for separated
intent resolution, the MVCCMetadata.TxnDidNotUpdateMeta
field will never be set to true.
See code comments and #69891 (comment)
Informs #69891
Release justification: fix for a release blocker that causes incorrect
behavior for transactional writes.
Release note: None