I've come across an interesting (not to say infuriatingly annoying) issue. I'm fairly new to Redis but I know how to operate the basics.
Basically I have a cluster with 3 masters and each master has 2 slaves each across three servers.
I have a bunch of normal keys and I try to clean all keys based on a pattern across all servers so I've run something like this on the master nodes:
for server in "${servers[@]}" do
./redis-cli -h ${server} -p ${master_port} KEYS 'pattern:*' | xargs -I {} ./redis-cli -h ${server} -p ${master_port} DEL {}
done
Now this works nicely, it looks like all the keys get deleted as they should however, when I run the KEYS 'pattern:*'
command again on each server, keys belonging to master 1
appears in the list of master 2
. If I try to access the key with get <key>
I properly get a moved
notice and if I do the same thing using the -c
follow parameter I get correctly redirected and recieve a nil
back.
I've tried this same thing with scan
using both lua and ruby script but both output the should-be-deleted keys on the node that didn't have the keys in the first place.
Is there any way to delete these keys for good so I can get a trustworthy count/evidence that they're gone?