Closed dkropachev closed 3 weeks ago
I'm not sure, but it may have been done in purpose - we did not want to pull the data for 100,000 tablets every time. @sylwiaszunejko ?
Without it driver can't properly pick connection for range queries and very first query to the range is being made to a wrong shard.
We can limit it to a particular keyspace
+table
.
Without it driver can't properly pick connection for range queries and very first query to the range is being made to a wrong shard. We can limit it to a particular
keyspace
+table
.
Yes, the first query will be wrong, but it's better than consuming gozillion of tablets worth of information. I agree we can limit it to a specific ks+tbl. I thought we did or we discussed doing, but does it matter if it's after the 1st query or before it?
Yes, the first query will be wrong, but it's better than consuming gozillion of tablets worth of information. I agree we can limit it to a specific ks+tbl. I thought we did or we discussed doing, but does it matter if it's after the 1st query or before it?
it would be good to have it correctly routed, but in almost all cases, that I can image. it is not critical.
@dkropachev As @mykaul said, it was a design decision to not pull system.tablets
. We considered multiple approaches of getting tablet info to the drivers e.g. periodically pulling all of the tablets info, new type of an event with tablet change and lazy approach. The decision was made to go with lazy approach and send tablet info to the driver if query was not routed correctly.
So, I close it, as it works as designed
We may wish to document this somewhere, if it's not already.
Problem
Currently we fill in tables information only from prepared statement respose: https://github.com/scylladb/gocql/blob/dce12c13e8f4700bd53f1bdef30bb7d95d38efdd/conn.go#L1519
Which means that
Session.getTablets
does not have all the tablet information https://github.com/scylladb/gocql/blob/dce12c13e8f4700bd53f1bdef30bb7d95d38efdd/session.go#L612Which means that
schemaDescriber
andscyllaConnPicker
are using only partial tablet data and therefore do not yield correct results.Solution
Start pulling
system.tablet
ontopology change
events and at the startup.