redisraft
redisraft copied to clipboard
Inconsistent reads support
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.
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?
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.
this is supported via debug commands. i.e. in our integration tests we do https://github.com/RedisLabs/redisraft/blob/4d49063bdcb68926fe0d9c6e9bb26c29032fd62b/tests/integration/test_sanity.py#L35
i.e.
https://github.com/RedisLabs/redisraft/blob/4d49063bdcb68926fe0d9c6e9bb26c29032fd62b/tests/integration/sandbox.py#L266-L272
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.
JIRA ticket: https://redislabs.atlassian.net/browse/RR-318