Skip to content

Commit 3016563

Browse files
feat(main): use NetworkTopologyStrategy for SM ks by default
SimpleStrategy is not recommended for the production environments. It also does not support tablets, which are the way towards scylla is moving (in some distant time, vnodes might even be deprecated). Because of that, it also runs into unexpected problems like #4555. Because of those reasons, we should switch from keeping SM data in SimpleStrategy to NetworkTopologyStrategy keyspace by default. For the default, single local node SM DB cluster, both strategies result in the single node containing all of SM data. For single DC SM DB cluster they are also equivalent. On the other hand, for multi DC SM DB cluster (really not recommended...), NetworkTopologyStrategy results in keeping replication_factor replicas per DC and not per cluster. This is theoretically problematic, but such setup is also problematic for SimpleStrategy, which would still replicate the data in all DCs, so it's not a new problem. Moreover, this change only defines the default SM keyspace creation. In case user has some non-default (perhaps not recommended) SM DB setup, they can always create SM keyspace manually before starting SM server to configure it to their liking. Refs #4555
1 parent 6b59292 commit 3016563

File tree

1 file changed

+1
-1
lines changed
  • pkg/cmd/scylla-manager

1 file changed

+1
-1
lines changed

pkg/cmd/scylla-manager/db.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ func createKeyspace(ctx context.Context, c config.Config, logger log.Logger) err
5858
return session.Query(mustEvaluateCreateKeyspaceStmt(c)).Exec()
5959
}
6060

61-
const createKeyspaceStmt = "CREATE KEYSPACE {{.Keyspace}} WITH replication = {'class': 'SimpleStrategy', 'replication_factor': {{.ReplicationFactor}}}"
61+
const createKeyspaceStmt = "CREATE KEYSPACE {{.Keyspace}} WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': {{.ReplicationFactor}}}"
6262

6363
func mustEvaluateCreateKeyspaceStmt(c config.Config) string {
6464
t := template.New("")

0 commit comments

Comments
 (0)