From 1e7d9ea98f03f8ce757529b42c0f2ee707cd758f Mon Sep 17 00:00:00 2001 From: Steven Danna Date: Sat, 30 Sep 2023 15:03:50 +0100 Subject: [PATCH 1/3] streamingccl: clarify that license is needed on both clusters At least one user was confused by this. Perhaps this small update will make it more clear. Fixes #111525 Release note: None --- pkg/ccl/streamingccl/streamingest/stream_ingest_manager.go | 2 +- pkg/ccl/streamingccl/streamproducer/replication_manager.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/ccl/streamingccl/streamingest/stream_ingest_manager.go b/pkg/ccl/streamingccl/streamingest/stream_ingest_manager.go index 59e52be0b6a6..7413719055d6 100644 --- a/pkg/ccl/streamingccl/streamingest/stream_ingest_manager.go +++ b/pkg/ccl/streamingccl/streamingest/stream_ingest_manager.go @@ -66,7 +66,7 @@ func newStreamIngestManagerWithPrivilegesCheck( execCfg.Settings, execCfg.NodeInfo.LogicalClusterID(), "REPLICATION") if enterpriseCheckErr != nil { return nil, pgerror.Wrap(enterpriseCheckErr, - pgcode.InsufficientPrivilege, "replication requires enterprise license") + pgcode.InsufficientPrivilege, "physical replication requires an enterprise license on the secondary (and primary) cluster") } isAdmin, err := evalCtx.SessionAccessor.HasAdminRole(ctx) diff --git a/pkg/ccl/streamingccl/streamproducer/replication_manager.go b/pkg/ccl/streamingccl/streamproducer/replication_manager.go index df81b8a650f9..74600866dda1 100644 --- a/pkg/ccl/streamingccl/streamproducer/replication_manager.go +++ b/pkg/ccl/streamingccl/streamproducer/replication_manager.go @@ -92,7 +92,7 @@ func newReplicationStreamManagerWithPrivilegesCheck( execCfg.Settings, execCfg.NodeInfo.LogicalClusterID(), "REPLICATION") if enterpriseCheckErr != nil { return nil, pgerror.Wrap(enterpriseCheckErr, - pgcode.InsufficientPrivilege, "replication requires enterprise license") + pgcode.InsufficientPrivilege, "physical replication requires an enterprise license on the primary (and secondary) cluster") } return &replicationStreamManagerImpl{evalCtx: evalCtx, txn: txn}, nil From 1a3c7579b36ae605c1a1842ee3a6efa01899293e Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Mon, 2 Oct 2023 14:37:33 +0200 Subject: [PATCH 2/3] configprofiles: avoid slices stomping each other This patch ensures that each config profile has its distinct task slice. (I'm somewhat surprised this fix only affects the test outputs. I have tried manually to set up a cluster with either profile and the settings were right.) Release note: None --- pkg/configprofiles/profiles.go | 2 +- pkg/configprofiles/testdata/virtual-app-repl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/configprofiles/profiles.go b/pkg/configprofiles/profiles.go index 4c17d60a04f1..7887901112f7 100644 --- a/pkg/configprofiles/profiles.go +++ b/pkg/configprofiles/profiles.go @@ -141,7 +141,7 @@ var virtClusterWithAppServiceInitTasks = append( ) func enableReplication(baseTasks []autoconfigpb.Task) []autoconfigpb.Task { - return append(baseTasks, + return append(baseTasks[:len(baseTasks):len(baseTasks)], makeTask("enable rangefeeds and replication", /* nonTxnSQL */ []string{ "SET CLUSTER SETTING kv.rangefeed.enabled = true", diff --git a/pkg/configprofiles/testdata/virtual-app-repl b/pkg/configprofiles/testdata/virtual-app-repl index 9fd541fb4a07..1103f07f2f79 100644 --- a/pkg/configprofiles/testdata/virtual-app-repl +++ b/pkg/configprofiles/testdata/virtual-app-repl @@ -27,8 +27,8 @@ WHERE variable IN ( ) ORDER BY variable ---- -cross_cluster_replication.enabled false -kv.rangefeed.enabled false +cross_cluster_replication.enabled true +kv.rangefeed.enabled true server.controller.default_target_cluster application spanconfig.range_coalescing.application.enabled false spanconfig.range_coalescing.system.enabled false From 3b8d1ad1c7a45a382959ddc4a95f93be8dae5b21 Mon Sep 17 00:00:00 2001 From: Raphael 'kena' Poss Date: Mon, 2 Oct 2023 14:39:26 +0200 Subject: [PATCH 3/3] configprofiles: fix typo Release note: None --- pkg/configprofiles/profiles.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/configprofiles/profiles.go b/pkg/configprofiles/profiles.go index 7887901112f7..fd0bd857cc54 100644 --- a/pkg/configprofiles/profiles.go +++ b/pkg/configprofiles/profiles.go @@ -112,7 +112,7 @@ var virtClusterInitTasks = []autoconfigpb.Task{ }, ), // Finally. - makeTask("use the application virtual cluster template by default in CREATE VIRTUAL CLSUTER", + makeTask("use the application virtual cluster template by default in CREATE VIRTUAL CLUSTER", /* nonTxnSQL */ []string{ "SET CLUSTER SETTING sql.create_virtual_cluster.default_template = 'template'", },