We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The way in which DescribeRing calculates keyspace replication strategy isn't always correct.
DescribeRing
// Detect replication strategy if len(ring.HostDC) == 1 { ring.Replication = LocalStrategy } else { ring.Replication = NetworkTopologyStrategy for _, tokens := range dcTokens { if tokens != len(resp.Payload) { ring.Replication = SimpleStrategy break } } }
E.g. this test fails when SimpleStrategy RF is greater than half of the nodes count:
SimpleStrategy
t.Run("keyspace replication strategy", func(t *testing.T) { h := newRepairTestHelper(t, session, defaultConfig()) ctx, cancel := context.WithCancel(context.Background()) defer cancel() if err := clusterSession.ExecStmt("CREATE KEYSPACE test_rf WITH replication = {'class': 'SimpleStrategy', 'replication_factor' : 4}"); err != nil { t.Fatal(err) } defer dropKeyspace(t, clusterSession, "test_rf") ring, err := h.Client.DescribeRing(ctx, "test_rf") if err != nil { t.Fatal(err) } t.Log("Replication strategy", ring.Replication) if ring.Replication != scyllaclient.SimpleStrategy { t.Fatal("Incorrect replication strategy") } })
The text was updated successfully, but these errors were encountered:
fix(scylla_client): fix strategy calculation in DescribeRing
0318bf2
Fixes #3745
3c6193d
d1d918b
033a90f
c003270
1ae2e81
Michal-Leszczynski
Successfully merging a pull request may close this issue.
The way in which
DescribeRing
calculates keyspace replication strategy isn't always correct.E.g. this test fails when
SimpleStrategy
RF is greater than half of the nodes count:The text was updated successfully, but these errors were encountered: