Skip to content

Read in absence of viable writer #355

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

Merged
merged 1 commit into from
Apr 12, 2017

Conversation

lutovich
Copy link
Contributor

Previously driver did not allow reads and writes when received routing table did not contains both routers, readers and writers. This was inconsistent with Causal Cluster which allows reads when leader is absent. Leader might be unavailable for a long time (when there is a DC failure, etc.) so it makes sense to allow clients to perform read activity.

This commit makes driver accept routing table with no writers and allow clients to perform read operations when writers are not available. It might be problematic when there is a cluster partition and one partition contains majority. For this case special care must be taken so driver does not get stuck talking only to the smaller partition which only knows about itself. This is done on best effort basis - driver tries to contact seed router if previously accepted routing table did not contain writes.

Previously driver did not allow reads and writes when received routing
table did not contains both routers, readers and writers. This was
inconsistent with Causal Cluster which allows reads when leader is absent.
Leader might be unavailable for a long time (when there is a DC failure, etc.)
so it makes sense to allow clients to perform read activity.

This commit makes driver accept routing table with no writers and allow
clients to perform read operations when writers are not available. It
might be problematic when there is a cluster partition and one partition
contains majority. For this case special care must be taken so driver
does not get stuck talking only to the smaller partition which only
knows about itself. This is done on best effort basis - driver tries
to contact seed router if previously accepted routing table did not
contain writes.
@@ -115,7 +116,7 @@ public void removeWriter( BoltServerAddress toRemove )


@Override
public String toString()
public synchronized String toString()
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's revisit this synchronized code in another PR.

@zhenlineo zhenlineo merged commit 4434a0b into neo4j:1.3 Apr 12, 2017
@lutovich lutovich deleted the 1.3-read-without-writer branch April 12, 2017 09:23
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