-
Notifications
You must be signed in to change notification settings - Fork 38
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
Introduce support for tablets [3.x] #237
Introduce support for tablets [3.x] #237
Conversation
55ae641
to
6b6004c
Compare
6b6004c
to
2fce280
Compare
2fce280
to
fedd5e0
Compare
fedd5e0
to
9956aee
Compare
9956aee
to
439f933
Compare
Reworked this completely to use solely tablets-routing-v1 protocol extension. |
8807dab
to
0d72142
Compare
Fixed silent NPE I missed before |
driver-core/src/main/java/com/datastax/driver/core/DefaultResultSetFuture.java
Outdated
Show resolved
Hide resolved
if (keyspace != null && table != null) { | ||
assert t instanceof Token.TokenLong64; | ||
shardId = metadata.getShardForTabletToken(keyspace, table, (Token.TokenLong64) t, host); | ||
} |
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.
Perhaps add protection here against too-large shardId.
Scenario:
- we get routing information for a tablet
- node restarts with fewer shards
- we look up routing information, get a shard that no longer exists
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.
Changed 'this' to min(shardCount, 'this')
if (defs != null && defs.size() > 0) { | ||
statementTable = defs.getTable(0); | ||
} | ||
|
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.
You could capture the tablet map during prepare time and put it into statement itself, avoiding all the casting and checks here. Probably negligible in terms of performance.
c693eff
to
78ec7f1
Compare
78ec7f1
to
9d6587c
Compare
This PR introduces changes to the driver that are necessary for shard-awareness and token-awareness to work effectively with the tablets feature recently introduced to ScyllaDB. It overwrites the ring-based replica calculations on tablet-enabled keyspaces. Now if driver sends the request to the wrong node/shard it will get the correct tablet information from Scylla in custom payload. It uses this information to obtain target replicas and shard numbers for tables managed by tablet replication. This tablet information is then stored in the driver and is used for correctly routing all next requests.
9d6587c
to
6c6052d
Compare
As for additional manual testing:
|
ScyllaDB Java Driver 3.11.5.2 supports tablet awareness in the driver. Update the version in scylla-tools-java so that cassandra-stress can take advantage of this new functionality. Before releasing Java Driver 3.11.5.2 we ran several tests with cassandra-stress to make sure that it's stable (under tablet migration, topology changes) and that there is no performance regression. (more details here: scylladb/java-driver#237 (comment))
ScyllaDB Java Driver 3.11.5.2 adds tablet awareness to the driver. Update the version of the driver in scylla-tools-java so that cassandra-stress can take advantage of this new functionality. Before releasing Java Driver 3.11.5.2 we ran several tests with cassandra-stress to make sure that it's stable (under tablet migration, topology changes) and that there is no performance regression. (more details here: scylladb/java-driver#237 (comment))
ScyllaDB Java Driver 3.11.5.2 adds tablet awareness to the driver. Update the version of the driver in scylla-tools-java so that cassandra-stress can take advantage of this new functionality. Before releasing Java Driver 3.11.5.2 we ran several tests with cassandra-stress to make sure that it's stable (under tablet migration, topology changes) and that there is no performance regression. (more details here: scylladb/java-driver#237 (comment)) Closes: #381
This PR introduces changes to the driver that are necessary for
shard-awareness and token-awareness to work effectively with the
tablets feature recently introduced to ScyllaDB. It overwrites
the ring-based replica calculations on tablet-enabled keyspaces.
Now if driver sends the request to the wrong node/shard it will get the
correct tablet information from Scylla in custom payload. It uses this
information to obtain target replicas and shard numbers for tables
managed by tablet replication.
This tablet information is then stored in the driver and is used
for correctly routing all next requests.