Skip to content

Commit

Permalink
changefeedccl: Do not inhibit server shutdown.
Browse files Browse the repository at this point in the history
Informs #82765

Permanet fix is being tracked by the above issue.
This is a temporary fix to ensure that change aggregators
cancel their context when the server quiesces so that the
server shutdown is not inhibited by the running changefeeds.

The test for this functionality is not being merged due
to the fact that it takes too long to run; however, the test
can be seen here: #82767

Release Notes (enterprise change): Ensure running changefeeds do
not inhibit node shutdown.
  • Loading branch information
Yevgeniy Miretskiy committed Jun 10, 2022
1 parent 7c29b20 commit 145c9ee
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/ccl/changefeedccl/changefeed_processors.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,15 +208,15 @@ func (ca *changeAggregator) MustBeStreaming() bool {

// Start is part of the RowSource interface.
func (ca *changeAggregator) Start(ctx context.Context) {
// Derive a separate context so that we can shutdown the poller. Note that
// we need to update both ctx (used throughout this function) and
// ProcessorBase.Ctx (used in all other methods) to the new context.
ctx, ca.cancel = ca.flowCtx.Stopper().WithCancelOnQuiesce(ctx)

if ca.spec.JobID != 0 {
ctx = logtags.AddTag(ctx, "job", ca.spec.JobID)
}
ctx = ca.StartInternal(ctx, changeAggregatorProcName)

// Derive a separate context so that we can shutdown the poller. Note that
// we need to update both ctx (used throughout this function) and
// ProcessorBase.Ctx (used in all other methods) to the new context.
ctx, ca.cancel = context.WithCancel(ctx)
ca.Ctx = ctx

spans, err := ca.setupSpansAndFrontier()
Expand Down

0 comments on commit 145c9ee

Please sign in to comment.