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: refactor kvfeed startup in changeaggregator processor #109345

Merged
merged 1 commit into from
Aug 25, 2023

Conversation

jayshrivastava
Copy link
Contributor

@jayshrivastava jayshrivastava commented Aug 23, 2023

changefeedccl: refactor kvfeed startup in changeaggregator processor
This change cleans up the code used to start up the kv feed
in change aggregator processors. This change removes uncessessary code,
adds a better API, and makes code easier to reason about.

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 force-pushed the kvfeed-refator branch 3 times, most recently from dedeec0 to f0fc374 Compare August 25, 2023 16:09
This change cleans up the code used to start up the kv feed
in change aggregator processors. This change removes uncessessary code,
adds a better API, and makes code easier to reason about.

Informs: cockroachdb#96953
Release note: None
Epic: None
@jayshrivastava jayshrivastava changed the title Kvfeed refator changefeedccl: refactor kvfeed startup in changeaggregator processor Aug 25, 2023
ca.eventProducer, err = ca.startKVFeed(ctx, spans, kvFeedHighWater, needsInitialScan, feed)
// TODO(yevgeniy): Introduce separate changefeed monitor that's a parent
// for all changefeeds to control memory allocated to all changefeeds.
pool := ca.flowCtx.Cfg.BackfillerMonitor
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I will probably add our own monitor in a subsequent PR.

@jayshrivastava jayshrivastava marked this pull request as ready for review August 25, 2023 17:04
@jayshrivastava jayshrivastava requested a review from a team as a code owner August 25, 2023 17:04
// but only the first one is ever used.
ca.errCh = make(chan error, 2)
ca.kvFeedDoneCh = make(chan struct{})
errCh := make(chan error, 1)
Copy link
Contributor

Choose a reason for hiding this comment

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

are we sure this is safe?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see; yes it is.

@jayshrivastava
Copy link
Contributor Author

bors r=miretskiy

@craig craig bot merged commit ee7cdcf into cockroachdb:master Aug 25, 2023
@craig
Copy link
Contributor

craig bot commented Aug 25, 2023

Build succeeded:

@jayshrivastava jayshrivastava deleted the kvfeed-refator branch August 28, 2023 19:01
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