-
Notifications
You must be signed in to change notification settings - Fork 49
Move away from simple strat for SM keyspace #4727
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a3d37f5
19e3b21
9dba132
2e0a379
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,10 +8,10 @@ import ( | |
| "text/template" | ||
| "time" | ||
|
|
||
| "github.com/scylladb/go-log/gocqllog" | ||
|
|
||
| "github.com/gocql/gocql" | ||
| "github.com/pkg/errors" | ||
| "github.com/scylladb/go-log" | ||
| "github.com/scylladb/go-log/gocqllog" | ||
| "github.com/scylladb/gocqlx/v2" | ||
| "github.com/scylladb/gocqlx/v2/dbutil" | ||
| "github.com/scylladb/gocqlx/v2/migrate" | ||
|
|
@@ -55,10 +55,15 @@ func createKeyspace(ctx context.Context, c config.Config, logger log.Logger) err | |
| } | ||
| } | ||
|
|
||
| return session.Query(mustEvaluateCreateKeyspaceStmt(c)).Exec() | ||
| ksCreateStmt := mustEvaluateCreateKeyspaceStmt(c) | ||
| if err := session.Query(ksCreateStmt).Exec(); err != nil { | ||
| return errors.Wrapf(err, "failed to create manager keyspace with %q, "+ | ||
| "consider creating it manually and starting manager server again", ksCreateStmt) | ||
| } | ||
| return nil | ||
| } | ||
|
|
||
| const createKeyspaceStmt = "CREATE KEYSPACE {{.Keyspace}} WITH replication = {'class': 'SimpleStrategy', 'replication_factor': {{.ReplicationFactor}}}" | ||
| const createKeyspaceStmt = "CREATE KEYSPACE {{.Keyspace}} WITH replication = {'class': 'NetworkTopologyStrategy', 'replication_factor': {{.ReplicationFactor}}}" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you know how big this table is in production? When tablets are enabled, it will create 10 tablets/shard by default. Maybe we should start small and let a load balancer split it when needed. \cc @bhalevy
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See this comment for more context. |
||
|
|
||
| func mustEvaluateCreateKeyspaceStmt(c config.Config) string { | ||
| t := template.New("") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the manager server created once a cluster is fully constructed? By default RF=3 is used. That requires 3 nodes/racks to already exist. Otherwise, the keyspace will not be created.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See this comment for more context.