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
Get keyspace notifications only if key changed #2149
IMPORTANT all the commands generate events only if the target key is really
modified. For instance an SREM deleting a non-existing element from a Set will
not actually change the value of the key, so no event will be generated.
However, when i tried to set key with value which it already had, i
received notification to.
$ redis-cli config set notify-keyspace-events KEA
$ redis-cli psubscribe '__key*__:*'
$ redis-cli set test 1
Now i'm get "pmessage","__key*__:*","__keyspace@0__:test","set"
$ redis-cli set test 1
Now i'm get it to, but value didn't change! "pmessage","__key*__:*","__keyspace@0__:test","set"
Twice the same value is still considered a real change. Redis doesn't compare values so it can't know if you just reset the same value again or a new one (always checking for equality would be more expensive then just setting it).
The docu lists only an example for a non-existent key. Deleting something that isn't there is essentially a noop and thus not reported.
Activity
badboy commentedon Nov 19, 2014
Twice the same value is still considered a real change. Redis doesn't compare values so it can't know if you just reset the same value again or a new one (always checking for equality would be more expensive then just setting it).
The docu lists only an example for a non-existent key. Deleting something that isn't there is essentially a noop and thus not reported.
zhazhdam3st1 commentedon Nov 19, 2014
Thank you for explaining.
Update RedisTimeSeries to version 8.11.90 (#15969)