Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

papishetty.praneeth_19978 avatar image
papishetty.praneeth_19978 asked ·

Why does the Node.js driver report "consistency=6" in the logs when we use LOCAL_QUORUM?

We are using nodejs driver to connect to cassandra and we use the retry policy when localquorum cannot be satisfied.

when there is a node down and this policy kicks in, the log says the consistency 6 . here is the example log message .

"retrying query with lower consistency" retryCount=3 consistency=6 required=2 alive=1

retry policy

https://github.com/datastax/nodejs-driver/blob/f9b3767e2357442aae43dc0c7744b382d529ec22/lib/policies/retry.js#L41

the enum configured for localquorum

https://github.com/datastax/nodejs-driver/blob/f9b3767e2357442aae43dc0c7744b382d529ec22/lib/types/index.d.ts#L33

Can someone please explain why the consistency is enumed.

Thanks

drivers
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

jorgebg avatar image
jorgebg answered ·

Consistency level is represented in JavaScript as an object with names and a code, as enums are not supported natively in JavaScript.


If you are reporting the consistency level to your log system, you can use consistencyToString object to represent it as a string: https://docs.datastax.com/en/developer/nodejs-driver/4.5/api/module.types/#consistency-tostring

1 comment Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.