redisraft icon indicating copy to clipboard operation
redisraft copied to clipboard

Inconsistent reads support

Open MTigra opened this issue 3 years ago • 4 comments

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.

MTigra avatar May 05 '21 22:05 MTigra

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?

yossigo avatar May 06 '21 16:05 yossigo

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.

MTigra avatar May 06 '21 21:05 MTigra

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.

sjpotter avatar Jun 16 '21 13:06 sjpotter

JIRA ticket: https://redislabs.atlassian.net/browse/RR-318

fadidahanna avatar Jul 06 '23 15:07 fadidahanna