Skip to content

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

Open
Jens-G wants to merge 1 commit into
OrleansContrib:masterfrom
Jens-G:prb-3-nodes
Open

Cassandra.UnavailableExeption thrown in small test environments with only one node#3
Jens-G wants to merge 1 commit into
OrleansContrib:masterfrom
Jens-G:prb-3-nodes

Conversation

@Jens-G

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

Copy link
Copy Markdown

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

@Jens-G

Jens-G commented Oct 20, 2019

Copy link
Copy Markdown
Author

Anything wrong with this?

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

Copy link
Copy Markdown

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
Copy Markdown

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