StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

Still hitting RedisCommandException for "Command cannot be issued to a replica: UNLINK"

Open dylHall opened this issue 7 months ago • 2 comments

Hi folks,

Our team previously opened an issue surrounding RedisCommandExceptions for "Command cannot be issued to a replica" - https://github.com/StackExchange/StackExchange.Redis/issues/2016

I believe we've taken the version with the fix (we're using 2.7.17, and looks like that fix was in 2.6.66), however, we still end up getting noise from this exception. As mentioned in the previous issue, this is a reasonable error, but we are not intentionally targeting a replica, we're likely being exposed to the low-level details of the failover that is occurring.

At least from our perspective, having the exception type changed would be super useful here, as we expect valid (semantic) commands from us should not be RedisCommandExceptions.

As previously, we're certainly open to suggestions or other fixes here!

Cheers, Dylan

dylHall avatar May 30 '25 22:05 dylHall

We're also running into this problem with Sentinel and deleting keys. There is always a chance to get Command cannot be issued to a replica: UNLINK.

OronDF343 avatar Aug 21 '25 12:08 OronDF343

The solution for us was to ensure that port 26379 and the ServiceName are specified in the config, as well as upgrading the package.

OronDF343 avatar Aug 21 '25 13:08 OronDF343