Skip to content
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

kvserver, kvclient: allow Rangefeeds to run over non-voting replicas #59507

Merged
merged 1 commit into from
Mar 3, 2021

Conversation

aayushshah15
Copy link
Contributor

@aayushshah15 aayushshah15 commented Jan 28, 2021

Fixes #59454.

Release justification: low risk high benefit change to be able to fuel CDC streams using non-voting replicas

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@aayushshah15 aayushshah15 force-pushed the rangefeeds-on-non-voters branch from 864ee08 to 64ba572 Compare January 28, 2021 04:24
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 2 files at r4.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @aayushshah15)


pkg/kv/kvserver/replica_rangefeed_test.go, line 121 at r4 (raw file):

		tc.SplitRangeOrFatal(t, startKey)

		if withNonVoters {

Instead of the RunTrueAndFalse, maybe we just add 2 voters and 2 non-voters and make sure that all 5 replicas can serve rangefeeds?


pkg/kv/kvserver/replica_rangefeed_test.go, line 161 at r4 (raw file):

					WithDiff: true,
				}
				pErr := store.RangeFeed(&req, stream)

Is this test testing the change you made in this PR? It's a good test case to add regardless, but it doesn't seem to be going through the DistSender. Does the test pass even if you revert the other half of this change?

@aayushshah15
Copy link
Contributor Author

woops, I didn't realize this wasn't a draft PR. Was lazily prototyping & wanted CI to run on it.

@nvanbenschoten
Copy link
Member

@amruss this is the PR you'll want to wait on before testing CDC + multi-region.

@aayushshah15 aayushshah15 force-pushed the rangefeeds-on-non-voters branch from 64ba572 to bbe89cf Compare March 2, 2021 07:53
Copy link
Contributor Author

@aayushshah15 aayushshah15 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 @nvanbenschoten)


pkg/kv/kvserver/replica_rangefeed_test.go, line 121 at r4 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Instead of the RunTrueAndFalse, maybe we just add 2 voters and 2 non-voters and make sure that all 5 replicas can serve rangefeeds?

Done.


pkg/kv/kvserver/replica_rangefeed_test.go, line 161 at r4 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

Is this test testing the change you made in this PR? It's a good test case to add regardless, but it doesn't seem to be going through the DistSender. Does the test pass even if you revert the other half of this change?

Added a new test.

@aayushshah15 aayushshah15 force-pushed the rangefeeds-on-non-voters branch from bbe89cf to 12389de Compare March 2, 2021 15:38
Copy link
Member

@nvanbenschoten nvanbenschoten left a comment

Choose a reason for hiding this comment

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

:lgtm: though the test seems to be having issues:

=== RUN   TestRangefeedIsRoutedToNonVoter
    test_log_scope.go:73: test logs captured to: /go/src/github.com/cockroachdb/cockroach/artifacts/logTestRangefeedIsRoutedToNonVoter106363519
    test_log_scope.go:74: use -show-logs to present logs inline
panic: test timed out after 15m0s

goroutine 53 [chan receive, 14 minutes]:
github.com/cockroachdb/cockroach/pkg/kv/kvserver_test.TestRangefeedIsRoutedToNonVoter(0xc000103500)
	/go/src/github.com/cockroachdb/cockroach/pkg/kv/kvserver/client_rangefeed_test.go:231 +0x82e
testing.tRunner(0xc000103500, 0x4e19a48)
	/usr/local/go/src/testing/testing.go:1123 +0xef
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:1168 +0x2b3

Reviewed 19 of 19 files at r5.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

Prior to this commit, RangeFeeds only worked over voting replicas. This
included followers as well as the leaseholder. This commit allows
rangefeeds to run over non-voting replicas as well.

Release justification: low risk high reward change to be able to fuel
CDC streams using non-voting replicas

Release note: None
@aayushshah15 aayushshah15 force-pushed the rangefeeds-on-non-voters branch from 12389de to 839de54 Compare March 3, 2021 14:58
@aayushshah15
Copy link
Contributor Author

Fixed CI.

TFTR!

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 3, 2021

Build failed (retrying...):

@craig
Copy link
Contributor

craig bot commented Mar 3, 2021

Build failed (retrying...):

@aayushshah15
Copy link
Contributor Author

bors r-

@craig
Copy link
Contributor

craig bot commented Mar 3, 2021

Canceled.

@aayushshah15
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Mar 3, 2021

Build succeeded:

@craig craig bot merged commit 44ea98b into cockroachdb:master Mar 3, 2021
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.

kvserver: allow rangefeeds over non-voting replicas
3 participants