question

papishetty.praneeth_19978 avatar image
papishetty.praneeth_19978 asked Erick Ramirez edited

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

node.js driver
10 |1000

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 Erick Ramirez edited

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

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

papishetty.praneeth_19978 avatar image papishetty.praneeth_19978 commented ·

Thank you

0 Likes 0 ·