From b4b15f8102115465e54fc27fdbcdf9b02e8cfa6c Mon Sep 17 00:00:00 2001 From: Wenyi Hu Date: Wed, 1 May 2024 13:49:17 +0000 Subject: [PATCH] changefeedccl: disable drain watcher by default #102717 introduced a mechanism allowing for an orderly shutdown of changefeed aggregators and an up-to-date frontier information to reduce duplicates during a node restart in 23.2. However, we've recently identified a bug that could lead to unexpected behavior. It's unclear where the bug is yet. This patch disables this feature by default. Fixes: #123371 Release note: Disabled a changefeed optimization on reducing duplicates during aggregator restarts due to its bad performance. --- pkg/ccl/changefeedccl/changefeed_processors.go | 2 +- pkg/ccl/changefeedccl/changefeed_test.go | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/ccl/changefeedccl/changefeed_processors.go b/pkg/ccl/changefeedccl/changefeed_processors.go index e4bee1aadaf2..52065ea0b9e2 100644 --- a/pkg/ccl/changefeedccl/changefeed_processors.go +++ b/pkg/ccl/changefeedccl/changefeed_processors.go @@ -137,7 +137,7 @@ var aggregatorEmitsShutdownCheckpoint = settings.RegisterBoolSetting( settings.ApplicationLevel, "changefeed.shutdown_checkpoint.enabled", "upon shutdown aggregator attempts to emit an up-to-date checkpoint", - true, + false, ) type drainWatcher <-chan struct{} diff --git a/pkg/ccl/changefeedccl/changefeed_test.go b/pkg/ccl/changefeedccl/changefeed_test.go index ded98d3a3825..7d40d27ba7de 100644 --- a/pkg/ccl/changefeedccl/changefeed_test.go +++ b/pkg/ccl/changefeedccl/changefeed_test.go @@ -6207,6 +6207,7 @@ func TestChangefeedHandlesRollingRestart(t *testing.T) { db := tc.ServerConn(1) sqlDB := sqlutils.MakeSQLRunner(db) + serverutils.SetClusterSetting(t, tc, "changefeed.shutdown_checkpoint.enabled", true) serverutils.SetClusterSetting(t, tc, "kv.rangefeed.enabled", true) serverutils.SetClusterSetting(t, tc, "kv.closed_timestamp.target_duration", 10*time.Millisecond) serverutils.SetClusterSetting(t, tc, "changefeed.experimental_poll_interval", 10*time.Millisecond)