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

Adds ReadOnly mode for Standalone/Cluster mode #69

Merged
merged 2 commits into from
Jun 11, 2015
Merged

Adds ReadOnly mode for Standalone/Cluster mode #69

merged 2 commits into from
Jun 11, 2015

Conversation

nakulgan
Copy link
Contributor

  • Cluster slots are now served with both Master and Slave instances.

The purpose is to use the client in a readonly mode to scale reads.

Each client individual issues a readonly once ready.
Each node in the cluster is connected to, maintaining a pool of Master nodes and SlaveNodes.

 - Cluster slots are now server with both Master and Slave instances

 - Fixes issue where slave node may be used for a write
@luin
Copy link
Collaborator

luin commented Jun 10, 2015

Awesome! I'll check it out ASAP.

@@ -163,7 +164,8 @@ Redis.defaultOptions = {
enableReadyCheck: true,
autoResubscribe: true,
autoResendUnfulfilledCommands: true,
lazyConnect: false
lazyConnect: false,
readOnly: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Since readOnly only works in cluster mode, we'd better only have it in cluster.js and listen to the ready event in the createNode method of cluster.js

@luin
Copy link
Collaborator

luin commented Jun 10, 2015

Just added some comments

@nakulgan
Copy link
Contributor Author

Cool, I agree on both of them. I'll update the PR with changes accordingly later today.

- Readonly is issued from cluster only and is removed from standalone client
luin added a commit that referenced this pull request Jun 11, 2015
Adds ReadOnly mode for Standalone/Cluster mode
@luin luin merged commit c06abec into redis:master Jun 11, 2015
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.

None yet

2 participants