changefeedccl: fix flush_hist_nanos callback #128991
Open
+1
−15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The flush_hist_nanos metric is calculated in a metrics callback. Before this change, the cloud storage and webhook v1 sinks would immediately call the callback before performing flush logic, which led to unexpectedly small flush_hist_nanos. This change moves the callback out of sink-specific logic so that the callback is correctly deferred for all sinks.
Epic: CRDB-37337
Fixes: #121248
Release note (bug fix): The changefeed.flush_hist_nanos metric now tracks the time it takes to flush for the cloud storage and old webhook sinks. Before this change, changefeed.flush_hist_nanos would appear erroneously as near 0 for these sinks.