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

SET errors on Azure Redis cluster #1172

Closed
MatanShabtay opened this issue Jul 3, 2019 · 3 comments · Fixed by #1374
Closed

SET errors on Azure Redis cluster #1172

MatanShabtay opened this issue Jul 3, 2019 · 3 comments · Fixed by #1374

Comments

@MatanShabtay
Copy link

We have a Redis cluster on Azure (Premium P4 Redis size).
We've noticed that we're seeing a lot of SET / SETX failures specifcally on this Redis instance.

The error we see is [ partial details from the exception thrown]:
StackExchange.Redis.RedisConnectionException: Command cannot be issued to a slave: SET

at StackExchange.Redis.PhysicalBridge.WriteMessageToServerInsideWriteLock(PhysicalConnection connection, Message message) in C:\projects\stackexchange-redis\src\StackExchange.Redis\PhysicalBridge.cs:line 1221

Note that our application communicates with another Redis server on Azure that is not Redis cluster and we dont see these errors at all.

Any suggestions?
As a workaround, I thought about calling IDatabase.StringSetAsync with CommandFlag.MasterOnly

What do you think ?

@SarapinIT
Copy link

SarapinIT commented Aug 30, 2019

Hello, @MatanShabtay. On which version of the library do you have this problem? I tried to reproduce and I got it for the old version 1.0.245

@NickCraver
Copy link
Collaborator

This is ultimately due to some reconnect issues after a redis failover behind the scenes in Azure. Folding this into #1120 which has another fix on the way in #1374 to resolve this scenario. The failover can trigger a stuck bad state on active pipes in our client that's been identified and is being resolved.

@yuzhangyi
Copy link

Hi, @NickCraver, could you help give some suggestion on following issue we meet in Redis? The version we used is StackExchange.Redis.2.0.601, thanks!

Failed to operate data with Redis Cache while error is: DeleteValueAsyncInternal failed with key E940E38E-269B-4430-8891-D868F21170DB@EXTERNALACTIVITY, field 1456D447-5749-4EF8-A190-106E27F35665@1456D447-5749-4EF8-A190-106E27F35665 and exception StackExchange.Redis.RedisConnectionException: InternalFailure on HDEL E940E38E-269B-4430-8891-D868F21170DB@EXTERNALACTIVITY ---> StackExchange.Redis.RedisCommandException: Command cannot be issued to a slave: HDEL E940E38E-269B-4430-8891-D868F21170DB@EXTERNALACTIVITY
at StackExchange.Redis.PhysicalBridge.WriteMessageToServerInsideWriteLock(PhysicalConnection connection, Message message)
--- End of inner exception stack trace ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.DataTransfer.Common.AzureRedisDataManagement.RedisKeyValueCache.d__15.MoveNext()
InternalFailure on HDEL E940E38E-269B-4430-8891-D868F21170DB@EXTERNALACTIVITY.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants