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

Cassandra.UnavailableExeption thrown in small test environments with only one node #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jens-G
Copy link

@Jens-G Jens-G commented Jul 7, 2019

When there are less nodes, the driver throws Cassandra.UnavailableExeption, because the DefaultConsistencyLevel "Quorum" does not work in that special case.

@Jens-G
Copy link
Author

Jens-G commented Oct 20, 2019

Anything wrong with this?

if (cassandraOptions.ReplicationFactor < 3)
{
DefaultConsistencyLevel = ConsistencyLevel.One;
DefaultConsistencyQueryOptions.SetConsistencyLevel(DefaultConsistencyLevel);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is updating a global static field. Better to have an instance field instead

@ReubenBond
Copy link

Dropping the consistency level could lead to inconsistency. I suggest allowing the developer to configure the consistency level directly via the options if they cannot already.

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

Successfully merging this pull request may close these issues.

2 participants