You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
CRITICAL: SORT is now rejected in all replicas #2182
I see this commit started to refuse SORT command on replicas: 989528f
This doesn't seem right. We can use SORT in replicas, the replicas just need to be set as writable.
The fact that SORT is a writable command and had no SORT_RO was fixed in Redis 7 only.
In summary, SORT is a valid command on replicas, in any redis version that the command exists, it's just not valid on READONLY Replicas
@NickCraver - I think this is going to be applicable to any command that got moved around in #2101, I'm going to open a PR to revert the permissiveness for any command that pre-dates our command effort. I think what we did in #2101 is correct (in that we are diverting all the commands that would be rejected by a typical replica in keeping with the remainder of that pattern). However, it looks like for some the latent incosistencies have become load-bearing. I'll open that PR, and then I'll investigate to see if there's a good way to interrogate a replica to see if it's writeable.
@NickCraver I did a bit more digging, sounds like there is indeed a way to differentiate readable and writeable replicas slave_read_only / replica_read_only in the INFO. And what's better, it looks like StackExchange.Redis should already be differentiating these when it makes the decision as to allow the write or not see this bit of the PhysicalBridge. Taking that with some of the later comments in #2016 (which was predates 2101, and has addressed commands that should never have been diverted to a replica)- I'm wondering - is there may be something weird going on with the server selection logic that's causing some wires to be crossed? Think it might be worth pausing #2183 while this is looked into
@eduardobr - can you please share the exact error you are getting, the version of redis-server you are using, and the last version of StackExchange.Redis that these writeable-replica writes worked on? Thanks!
Ok so the base constructor for Message is using IsPrimaryOnly to decide to set the DemandMaster flag in the message, so when the multiplexer goes about selecting the server, it sees that demand master flag and does not consider the possibility that you're intentionally writing to a writeable replica.
@slorello89 the latest StackExchange.Redis version where Sort worked on replicas is 2.5.61.
Redis server 6.2.6.
Error:
StackExchange.Redis.RedisCommandException: Command cannot be issued to a replica: SORT [other command arguments]
Activity
slorello89 commentedon Jul 8, 2022
@NickCraver - I think this is going to be applicable to any command that got moved around in #2101, I'm going to open a PR to revert the permissiveness for any command that pre-dates our command effort. I think what we did in #2101 is correct (in that we are diverting all the commands that would be rejected by a typical replica in keeping with the remainder of that pattern). However, it looks like for some the latent incosistencies have become load-bearing. I'll open that PR, and then I'll investigate to see if there's a good way to interrogate a replica to see if it's writeable.
slorello89 commentedon Jul 15, 2022
@NickCraver I did a bit more digging, sounds like there is indeed a way to differentiate readable and writeable replicas
slave_read_only/replica_read_onlyin theINFO. And what's better, it looks like StackExchange.Redis should already be differentiating these when it makes the decision as to allow the write or not see this bit of the PhysicalBridge. Taking that with some of the later comments in #2016 (which was predates 2101, and has addressed commands that should never have been diverted to a replica)- I'm wondering - is there may be something weird going on with the server selection logic that's causing some wires to be crossed? Think it might be worth pausing #2183 while this is looked into@eduardobr - can you please share the exact error you are getting, the version of redis-server you are using, and the last version of StackExchange.Redis that these writeable-replica writes worked on? Thanks!
slorello89 commentedon Jul 15, 2022
@NickCraver - I see it,
Ok so the base constructor for Message is using
IsPrimaryOnlyto decide to set theDemandMasterflag in the message, so when the multiplexer goes about selecting the server, it sees that demand master flag and does not consider the possibility that you're intentionally writing to a writeable replica.There's two things we can do
Thoughts?
eduardobr commentedon Jul 15, 2022
@slorello89 the latest StackExchange.Redis version where Sort worked on replicas is 2.5.61.
Redis server 6.2.6.
Error:
StackExchange.Redis.RedisCommandException: Command cannot be issued to a replica: SORT [other command arguments]
moving pre 2.6.45 write commands that were not previously considered …