-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Description
we have 3 shards elasticache cluster (3 maters + a replica for each master). I occasionally/rarely getting MOVED errors on my expire commands. The cluster is stable and no slot redistribution is happening at all but yet I am getting this. I dug a bit into the code and I noticed you flag the expire command as readonly (see image below).
So my guess (still havent dug deeper into it). is it is routing the command to the correct shard but to the replica and getting a MOVED (since the replica probably cant update the expiry) and it then reforwards to the replica 16 times in a row exceeding the maxRedirection. And rarely cause it has to pick the replica 16 times in a row ie the probability is 1 in 2^16 or one in 65,000
The main question is why am I getting the MOVED error and how to resolve it
A side question would be why is expires marked as read only as it clearly updates the records metadata

Node.js Version
20.18
Redis Server Version
8.1
Node Redis Version
5.7
Platform
linux