Skip to content
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

Getting error when doing count(*) from elassandra table #228

Closed
jansee233 opened this issue Oct 5, 2018 · 3 comments
Closed

Getting error when doing count(*) from elassandra table #228

jansee233 opened this issue Oct 5, 2018 · 3 comments
Labels

Comments

@jansee233
Copy link

jansee233 commented Oct 5, 2018

Elasticsearch version:
"number" : "6.2.3",
"build_hash" : "e605ecd",
"build_date" : "2018-07-18T19:19:00.787857Z",
"build_snapshot" : false,
"lucene_version" : "7.2.1",
"minimum_wire_compatibility_version" : "5.6.0",
"minimum_index_compatibility_version" : "5.0.0"

Plugins installed: []

JVM version (java -version):
openjdk version "1.8.0_171"
OpenJDK Runtime Environment (build 1.8.0_171-8u171-b11-1~bpo8+1-b11)
OpenJDK 64-Bit Server VM (build 25.171-b11, mixed mode)

OS version (uname -a if on a Unix-like system):
Linux elassandra-0 4.15.0-1023-azure #24~16.04.1-Ubuntu SMP Wed Aug 29 12:54:36 UTC 2018 x86_64 GNU/Linux

Description of the problem including expected versus actual behavior:

Getting error when doing count() from elassandra table when it has more data" ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed o ut - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}" to Getting error when doing count() from elassandra
Steps to reproduce:

Please include a minimal but complete recreation of the problem, including
(e.g.) index creation, mappings, settings, query etc. The easier you make for
us to reproduce it, the more likely that somebody will take the time to look at it.

Provide logs (if relevant):

@jansee233 jansee233 changed the title Getting error when doing count(*) from elassandra table " ReadTimeout: Error from server: code=1200 [Coordinator node timed out waiting for replica nodes' responses] message="Operation timed o ut - received only 0 responses." info={'received_responses': 0, 'required_responses': 1, 'consistency': 'ONE'}" Getting error when doing count(*) from elassandra table Oct 8, 2018
@DBarthe
Copy link

DBarthe commented Oct 11, 2018

If your table is huge, count(*) can easily timeout.

You can increase the cqlsh timeout with :

 --connect-timeout=CONNECT_TIMEOUT
                       Specify the connection timeout in seconds (default: 5
                       seconds).
 --request-timeout=REQUEST_TIMEOUT
                       Specify the default request timeout in seconds
                       (default: 10 seconds).

Unlike a RDBMS, counting the number of records is an heavy operation in Cassandra (due to its distributed nature). Checkout this article if you want more understanding.

You may want to use nodetool tablestats to get some rough approximations about your tables.

@jansee233
Copy link
Author

spark job is writing data into elassandra tables. where to add --connect-timeout=CONNECT_TIMEOUT parameter as it should affect to all elassandra pods

@DBarthe
Copy link

DBarthe commented Oct 23, 2018

Under spark, it should be spark.cassandra.read.timeout_ms, see
https://github.com/datastax/spark-cassandra-connector/blob/master/doc/reference.md (never tried myself)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants