Skip to content

Commit

Permalink
Merge pull request #123223 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-24.1-123044

release-24.1: server: add kv.rangefeed.enabled to virtualized init
  • Loading branch information
stevendanna authored Sep 12, 2024
2 parents 64da035 + 86701d0 commit 66c7ee8
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -2246,25 +2246,30 @@ func (s *topLevelServer) runIdempontentSQLForInitType(
}

initAttempt := func() error {
const defaulVirtuallusterName = "main"
const defaultVirtualClusterName = "main"
switch typ {
case serverpb.InitType_VIRTUALIZED:
ie := s.sqlServer.execCfg.InternalDB.Executor()
_, err := ie.Exec(ctx, "init-create-app-tenant", nil, /* txn */
"CREATE VIRTUAL CLUSTER IF NOT EXISTS $1", defaulVirtuallusterName)
"CREATE VIRTUAL CLUSTER IF NOT EXISTS $1", defaultVirtualClusterName)
if err != nil {
return err
}
_, err = ie.Exec(ctx, "init-default-app-tenant", nil, /* txn */
"ALTER VIRTUAL CLUSTER $1 START SERVICE SHARED", defaulVirtuallusterName)
"ALTER VIRTUAL CLUSTER $1 START SERVICE SHARED", defaultVirtualClusterName)
if err != nil {
return err
}
fallthrough
case serverpb.InitType_VIRTUALIZED_EMPTY:
ie := s.sqlServer.execCfg.InternalDB.Executor()
_, err := ie.Exec(ctx, "init-default-target-cluster-setting", nil, /* txn */
"SET CLUSTER SETTING server.controller.default_target_cluster = $1", defaulVirtuallusterName)
"SET CLUSTER SETTING server.controller.default_target_cluster = $1", defaultVirtualClusterName)
if err != nil {
return err
}
_, err = ie.Exec(ctx, "init-rangefeed-enabled-cluster-setting", nil, /* txn */
"SET CLUSTER SETTING kv.rangefeed.enabled = true")
if err != nil {
return err
}
Expand Down

0 comments on commit 66c7ee8

Please sign in to comment.