Skip to content

kv: improve unit testing around txnSpanRefresher#40454

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/testRefresher
Sep 4, 2019
Merged

kv: improve unit testing around txnSpanRefresher#40454
craig[bot] merged 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/testRefresher

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Sep 4, 2019

This was decently tested through its inclusion in the TxnCoordSender,
but since I'm planning on changing some behavior to address #36431, I
figured we should first build up a test suite in the same style that
we have for other transaction interceptors.

Release note: None

@nvb nvb requested a review from tbg September 4, 2019 03:20
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
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 3 of 3 files at r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @nvanbenschoten)


pkg/kv/txn_interceptor_pipeliner_test.go, line 56 at r1 (raw file):

}

func (m *mockLockedSender) ChainMockSend(

Add a comment on the order in which things are chained.

@nvb nvb force-pushed the nvanbenschoten/testRefresher branch from 421d047 to 0ce4af9 Compare September 4, 2019 16:52
Copy link
Copy Markdown
Contributor Author

@nvb nvb 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 @tbg)


pkg/kv/txn_interceptor_pipeliner_test.go, line 56 at r1 (raw file):

Previously, tbg (Tobias Grieger) wrote…

Add a comment on the order in which things are chained.

Done.

This was decently tested through its inclusion in the TxnCoordSender,
but since I'm planning on changing some behavior to address cockroachdb#36431, I
figured we should first build up a test suite in the same style that
we have for other transaction interceptors.

Release note: None
@nvb nvb force-pushed the nvanbenschoten/testRefresher branch from 0ce4af9 to 6ffbc65 Compare September 4, 2019 18:37
@nvb
Copy link
Copy Markdown
Contributor Author

nvb commented Sep 4, 2019

bors r+

craig bot pushed a commit that referenced this pull request Sep 4, 2019
40435: storage: be more resilient to learner snap conflicts r=tbg a=danhhz

The replica addition code first adds it as a raft learner, then hands it
a snapshot, then promotes it to a voter. For various unfortunate reasons
described in the code, we have to allow the raft snapshot queue to
_also_ send snapshots to learners. A recent etcd change exposed that
this code has always been brittle to the raft snapshot queue winning the
race and starting the snapshot first by making the race dramatically
more likely.

After this commit, learner replica addition grabs a (best effort) lock
before the conf change txn to add the learner is started. This prevents
the race when the raft leader (and thus the raft snapshot queue for that
range) is on the same node.

Closes #40207

Release note: None

40454: kv: improve unit testing around txnSpanRefresher r=nvanbenschoten a=nvanbenschoten

This was decently tested through its inclusion in the TxnCoordSender,
but since I'm planning on changing some behavior to address #36431, I
figured we should first build up a test suite in the same style that
we have for other transaction interceptors.

Release note: None

Co-authored-by: Daniel Harrison <daniel.harrison@gmail.com>
Co-authored-by: Nathan VanBenschoten <nvanbenschoten@gmail.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Sep 4, 2019

Build succeeded

@craig craig bot merged commit 6ffbc65 into cockroachdb:master Sep 4, 2019
@nvb nvb deleted the nvanbenschoten/testRefresher branch September 5, 2019 17:40
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