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

Inconsistent reads support #99

Open
MTigra opened this issue May 5, 2021 · 4 comments
Open

Inconsistent reads support #99

MTigra opened this issue May 5, 2021 · 4 comments
Labels
enhancement New feature or request JIRA

Comments

@MTigra
Copy link

MTigra commented May 5, 2021

TL;DR This is a request to support inconsistent reads, i.e. reads that can be served from any node rather than just the leader (in a quorum or non-quorum manner).

This is a risky feature but may have some value in certain use cases.

Right now i see i can use "follower-proxy" configuration to make redisraft proxy any commands to leader. Also i see that it is possible to disable quorum-reads. Even if i turn off quorum-reads, it mandatory to send all requests to leader node. How can i configure, or maybe edit sources to make it possible to read from every nore, even if it is lack of consistency.

@yossigo
Copy link
Collaborator

yossigo commented May 6, 2021

There's currently no way to configure that.

When you disable quorum-reads, you risk reading stale data within the re-election interval because you may read from a demoted leader that does not yet know it was demoted.

What you're asking is a way to read from arbitrary nodes, which means there is practically NO guarantee about the data you read. For example, this could be a follower node that has just joined and did not get ANY data yet.

Can you describe your use case, and why do you think that would be useful?

@MTigra
Copy link
Author

MTigra commented May 6, 2021

Absolutely right. In my use case i mostly want write actions to be consistent, but its not important for read actions.
In my case i use redis mostly as cache to get better performance when reading data, but i also store that data in another storage, so data anyway would be safe.
Read actions, even they return incorrect data in some time not a problem, because they anyway WILL return correct data in some time later.

Probably it is not very common use case.

@yossigo yossigo changed the title How can I make it possible to do read operations from any node in cluster Inconsistent reads support May 9, 2021
@yossigo yossigo added the enhancement New feature or request label May 9, 2021
@sjpotter
Copy link
Contributor

this is supported via debug commands. i.e. in our integration tests we do

assert r2.raft_debug_exec('get', 'key') == b'value'

i.e.

def raft_debug_exec(self, *cmd):
"""
Execute the specified Redis command through RAFT.DEBUG EXEC,
so it executes locally and does not go through Raft interception.
"""
return self.client.execute_command('raft.debug', 'exec', *cmd)

I'm not sure if one would really want to do this in real life, but the support is already there for them to do it.

tezc added a commit to tezc/redisraft that referenced this issue Apr 20, 2022
391120db2 Refactor (RedisLabs#99)
fc5030581 Add raft_get_state_str() to get state as string (RedisLabs#100)
38d64cae2 Make raft_recv_entry()'s response parameter optional (RedisLabs#98)

git-subtree-dir: deps/raft
git-subtree-split: 391120db265597e2b286f2a0596444c211c8c84b
tezc added a commit to tezc/redisraft that referenced this issue Apr 26, 2022
bc37037bd Add raft_config() function for configuration (RedisLabs#102)
c4e2dab18 Delete unused return value of raft_update_commit_idx() (RedisLabs#103)
391120db2 Refactor (RedisLabs#99)
fc5030581 Add raft_get_state_str() to get state as string (RedisLabs#100)
38d64cae2 Make raft_recv_entry()'s response parameter optional (RedisLabs#98)

git-subtree-dir: deps/raft
git-subtree-split: bc37037bd8331351dd8468c6ac6f97bb29369d5a
@fadidahanna
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request JIRA
Projects
None yet
Development

No branches or pull requests

4 participants