I am using data stax java driver to query scylladb , i see this error while reading data from scylla RequestHandler: ip:9042 replied with server error (clustering key cartesian product size 600 is greater than maximum 100), defuncting connection.
2 Answers
This error is returned in order to prevent too large restriction sets from being generated, which may put a strain on your server. If you're aware of the risks and know a reasonable upper bound of the number of restrictions for your queries, you can manually change the maximum in scylla.yaml, e.g. max_clustering_key_restrictions_per_query: 650
. Note however, that this option has a warning in its description and it should be acknowledged:
Maximum number of distinct clustering key restrictions per query.
This limit places a bound on the size of IN tuples, especially when multiple
clustering key columns have IN restrictions. Increasing this value can result
in server instability.
In particular, setting this flag above a couple of hundred is risky - 600 should be alright, but at this point you could also consider rephrasing your query, so that they have less values in their IN
restrictions - perhaps splitting some queries into multiple smaller ones?
Source from Scylla tracker: https://github.com/scylladb/scylla/pull/4797
-
-
After config change i am getting this error => partition key cartesian product size 200 is greater than maximum 100 . Should we have max_partition_key_restrictions_per_query like property for reading partition key. Jan 28, 2020 at 4:24
-
3@ROHANVADJE there is another one for partition keys:
max_partition_key_restrictions_per_query
(github.com/scylladb/scylla/blob/…) It is 2 options that may be configured: github.com/scylladb/scylla/pull/4797/… Jan 28, 2020 at 7:01 -
thank you ,Its working now, But my reads are very slow compare to cassandra . Do you know any configs that I need to tweak to get better read performance. Jan 28, 2020 at 8:39
-
@ROHANVADJE there was an answer to the similar question here stackoverflow.com/a/59687819/6906571 . Share what you see, what you do and how you config to allow giving you any suggestions. Generally, there must be no use cases under which Scylla perform worse. Jan 28, 2020 at 9:06
it depends on the data shape and concurrency. If your rows are large and the concurrency is high, it is easy to cause scylla to run out of memory. If your rows are small and/or the concurrency is low, everything will be fine. It's okay to increase the parameter value, just be aware you're on dangerous ground and you should try to reduce your IN query cartesian product sizes.
max value can be set as 1000000000.