Skip to content

Commit e6668da

Browse files
committed
changefeedcccl: move to draining before cancelling proc
Once a proc's context has been cancelled, it may cease processing emitted rows or even emitted drain transition information, so if the processor implementation wishes to reliably emit information about why it is moving to draining, it should do so before it cancels its underlying base processor. Release note: none. Epic: none.
1 parent 47a00e3 commit e6668da

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/ccl/changefeedccl/changefeed_processors.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,10 @@ func (ca *changeAggregator) Next() (rowenc.EncDatumRow, *execinfrapb.ProducerMet
814814
err = kvFeedErr
815815
}
816816
}
817-
// Shut down the poller if it wasn't already.
818-
ca.cancel()
819817
log.Changefeed.Warningf(ca.Ctx(), "moving to draining due to error from tick: %v", err)
820818
ca.MoveToDraining(err)
819+
// Shut down the poller if it wasn't already.
820+
ca.cancel()
821821
break
822822
}
823823
}

0 commit comments

Comments
 (0)