cockroachdb / cockroachdb/cockroach

changefeedccl: fix flush_hist_nanos callback in cloud storage and webhook sinks

Open
#121,248 2 comments 0 reactions 0 assignees View on GitHub
A-cdc backport-23.1.x backport-23.2.x C-bug E-easy E-quick-win P-3 T-cdc
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

The [webhook v1](https://github.com/cockroachdb/cockroach/blob/9e1b016d87989f1d5d28fe9b34fedff7eaa6bcc1/pkg/ccl/changefeedccl/sink_webhook.go#L693) and [cloud storage](https://github.com/cockroachdb/cockroach/blob/e9a6d3d7c935dd347a4254729edf2db8c764dcbf/pkg/ccl/changefeedccl/sink_cloudstorage.go#L674) sinks both execute a callback to update the `changefeed.flush_hist_nanos` metric immediately, which is inaccurate. For webhook, the callback should be deferred. In the cloud storage sink, we already execute a callback in the async flush code path, so we could eliminate the bad callback and instead add one on the [sync flush code path](https://github.com/cockroachdb/cockroach/blob/eb3e5605c3f3fcef801589c96af4f923b64d4078/pkg/ccl/changefeedccl/sink_cloudstorage.go#L716).

Jira issue: CRDB-37153

Epic CRDB-37337

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.