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: webhook sink rewrite for increased throughput #93032

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/ccl/changefeedccl/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ go_library(
"sink_external_connection.go",
"sink_kafka.go",
"sink_kafka_connection.go",
"sink_processor.go",
"sink_pubsub.go",
"sink_sql.go",
"sink_webhook.go",
Expand Down
11 changes: 11 additions & 0 deletions pkg/ccl/changefeedccl/changefeedbase/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -279,3 +279,14 @@ var EventConsumerElasticCPUControlEnabled = settings.RegisterBoolSetting(
"determines whether changefeed event processing integrates with elastic CPU control",
true,
)

// WebhookSinkWorkers specifies the number of workers to use to handle batching
// and emitting to a webhook sink.
var WebhookSinkWorkers = settings.RegisterIntSetting(
settings.TenantWritable,
"changefeed.webhook_sink_workers",
"the number of workers to use when emitting events to the sink: "+
"0 assigns a reasonable default, >0 assigns the setting value",
0,
settings.NonNegativeInt,
)
4 changes: 3 additions & 1 deletion pkg/ccl/changefeedccl/sink.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ func getSink(
if err != nil {
return nil, err
}

numWorkers := changefeedbase.WebhookSinkWorkers.Get(&serverCfg.Settings.SV)
return validateOptionsAndMakeSink(changefeedbase.WebhookValidOptions, func() (Sink, error) {
return makeWebhookSink(ctx, sinkURL{URL: u}, encodingOpts, webhookOpts,
defaultWorkerCount(), timeutil.DefaultTimeSource{}, metricsBuilder)
int(numWorkers), timeutil.DefaultTimeSource{}, metricsBuilder)
})
case isPubsubSink(u):
// TODO: add metrics to pubsubsink
Expand Down
Loading