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

Default Consistency needs mandatory override? #74

Open
PrithivirajDamodaran opened this issue Mar 27, 2014 · 9 comments
Open

Default Consistency needs mandatory override? #74

PrithivirajDamodaran opened this issue Mar 27, 2014 · 9 comments

Comments

@PrithivirajDamodaran
Copy link

As wiki and NPM description says default consistency is QUORUM and it is optional for as shown client.execute(query, [params], [consistency], callback).

How come for default consistency Simple Select queries not working throwing consistency issues. I had to use var consistency = cql.types.consistencies.one; to help get my simple select query working.

Even client.execute examples shown in wiki/npm uses default consistency, am i missing something ?

Please advice.

@jorgebay
Copy link
Owner

A Cassandra cluster can respond with "Can not achieve consistency quorum" when some of the nodes are down, this is an expected behaviour.

For example, you have a keyspace with replication factor 2 and one of the nodes it is not responding.

If this is what is happening, then is an expected behaviour. You should tune the consistency level per query, the default values are just that...

@PrithivirajDamodaran
Copy link
Author

Thanks for the inputs,

Here are my values

  1. I have a key space with replication factor 1.
  2. I have only one cassandra node and it was up (as the nodetool said)

Should i look for anything else?

@jorgebay
Copy link
Owner

Using quorum on one node cluster should not be a problem.
If you are getting an error, could you post it?

@PrithivirajDamodaran
Copy link
Author

Sure. attached screen shot

screen shot 2014-03-30 at 10 29 33 pm

In the above code, i need uncomment the consistency declaration and use it along with query everything works fine.

@jorgebay
Copy link
Owner

Its a PoolConnectionError, it means that the connection could not be established to any of the nodes (in your case 1).

You should check if your node...
Have you tried using cqlsh tool?

@PrithivirajDamodaran
Copy link
Author

Does a PoolConnectionError go away if i introduce consistency override ?

@ivarconr
Copy link

Should the consistency level not default to ONE? http://www.datastax.com/docs/1.0/references/cql/index#specifying-consistency-level

@asilvas
Copy link

asilvas commented Jul 21, 2014

Changing that default would be very bad. Rely on a wrapper to provide YOUR default consistency, like priam: https://github.com/godaddy/node-priam

@ivarconr
Copy link

Agreed. Too bad it wasn't the expected default from the beginning.

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

No branches or pull requests

4 participants