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

changefeedccl: move node drain handling logic out of kvfeed #109340

Merged
merged 1 commit into from
Aug 23, 2023

Conversation

jayshrivastava
Copy link
Contributor

@jayshrivastava jayshrivastava commented Aug 23, 2023

Previously, the kvfeed was responsible for monitoring for
node drains using a goroutine. This change moves this logic
into the change aggregator and removes the goroutine.
Overall, this change makes the code more organized and performant.

This change was inspired by work being done for #109167. The
work in that PR requires being able to restart the kvfeed.
Having drain logic intermingled with the kvfeed makes
restarts much more complex, hard to review, prone to bugs, etc.

Informs: #96953
Release note: None
Epic: None

@blathers-crl
Copy link

blathers-crl bot commented Aug 23, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@jayshrivastava jayshrivastava marked this pull request as ready for review August 23, 2023 15:45
@jayshrivastava jayshrivastava requested a review from a team as a code owner August 23, 2023 15:45
@jayshrivastava jayshrivastava requested review from HonoreDB and miretskiy and removed request for a team August 23, 2023 15:45
Copy link
Contributor

@miretskiy miretskiy 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 r1.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @HonoreDB and @jayshrivastava)


pkg/ccl/changefeedccl/changefeed_processors.go line 639 at r1 (raw file):

	}

	if err := ca.checkForNodeDrain(); err != nil {

perhaps this should be called in the main loop (Next()?)


pkg/ccl/changefeedccl/kvfeed/kv_feed.go line 241 at r1 (raw file):

	defer func() {
		log.Errorf(ctx, "kvfeed OVERALL run %v\n", err)
	}()

stray debugging?

@jayshrivastava
Copy link
Contributor Author

bors r=miretskiy

@miretskiy
Copy link
Contributor

bors r-

@craig
Copy link
Contributor

craig bot commented Aug 23, 2023

Canceled.

Previously, the kvfeed was responsible for monitoring for
node drains using a goroutine. This change moves this logic
into the change aggregator and removes the goroutine.
Overall, this change makes the code more organized and performant.

This change was inspired by work being done for cockroachdb#109167. The
work in that PR requires being able to restart the kvfeed.
Having drain logic intermingled with the kvfeed makes
restarts much more complex, hard to review, prone to bugs, etc.

Informs: cockroachdb#96953
Release note: None
Epic: None
@jayshrivastava
Copy link
Contributor Author

bors r=miretskiy

@craig
Copy link
Contributor

craig bot commented Aug 23, 2023

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Contributor

craig bot commented Aug 23, 2023

Build succeeded:

@craig craig bot merged commit 44f66d4 into cockroachdb:master Aug 23, 2023
@jayshrivastava jayshrivastava deleted the move-drain-logic branch August 25, 2023 15: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