Skip to content

Conversation

@sumeerbhola
Copy link
Collaborator

…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

@sumeerbhola sumeerbhola requested review from a team, nicktrav, nvb and tbg September 15, 2021 16:13
@sumeerbhola sumeerbhola requested a review from a team as a code owner September 15, 2021 16:13
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@sumeerbhola sumeerbhola force-pushed the singledel_mixed_version branch from 899b9aa to 6b2e8ac Compare September 15, 2021 17:55
@sumeerbhola sumeerbhola requested review from a team and adityamaru and removed request for a team September 15, 2021 17:55
@sumeerbhola sumeerbhola force-pushed the singledel_mixed_version branch from 6b2e8ac to 10e6f72 Compare September 15, 2021 19:23
@sumeerbhola
Copy link
Collaborator Author

@tbg @nvanbenschoten reminder to take a look, since this is potentially a release blocker.

Copy link
Member

@tbg tbg left a 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: :shipit: 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.

Copy link
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: 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.

@sumeerbhola sumeerbhola force-pushed the singledel_mixed_version branch from 10e6f72 to 7054431 Compare September 17, 2021 13:38
Copy link
Collaborator Author

@sumeerbhola sumeerbhola left a 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: :shipit: 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 populateMeta at 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=false is 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

Copy link
Member

@tbg tbg left a 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: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @adityamaru, @nicktrav, and @nvanbenschoten)

@sumeerbhola
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 17, 2021

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
@sumeerbhola
Copy link
Collaborator Author

sumeerbhola commented Sep 17, 2021

acceptance/cli/node-status seems flaky #70169

@sumeerbhola sumeerbhola force-pushed the singledel_mixed_version branch from 7054431 to ad320f0 Compare September 17, 2021 18:53
@sumeerbhola
Copy link
Collaborator Author

bors r+

@craig
Copy link
Contributor

craig bot commented Sep 17, 2021

Build succeeded:

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