Skip to content

Commit

Permalink
Merge pull request #137011 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-24.2-136926

release-24.2: sql/server: Fix license disable bug for single node clusters
  • Loading branch information
spilchen authored Dec 12, 2024
2 parents 622263c + b3e6d10 commit b953d44
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/server/initial_sql.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ import (
func (s *topLevelServer) RunInitialSQL(
ctx context.Context, startSingleNode bool, adminUser, adminPassword string,
) error {
if startSingleNode {
s.sqlServer.disableLicenseEnforcement(ctx)
}

newCluster := s.InitialStart() && s.NodeID() == kvstorage.FirstNodeID
if !newCluster || s.cfg.DisableSQLServer {
// The initial SQL code only runs the first time the cluster is initialized.
Expand All @@ -42,9 +46,6 @@ func (s *topLevelServer) RunInitialSQL(
}
log.Ops.Infof(ctx, "Replication was disabled for this cluster.\n"+
"When/if adding nodes in the future, update zone configurations to increase the replication factor.")

// Disable license enforcement too
s.sqlServer.disableLicenseEnforcement(ctx)
}

if adminUser != "" && !s.Insecure() {
Expand Down

0 comments on commit b953d44

Please sign in to comment.