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

LUA publish twice #3795

Open
Nizhegorodtsev opened this issue Feb 7, 2017 · 0 comments
Open

LUA publish twice #3795

Nizhegorodtsev opened this issue Feb 7, 2017 · 0 comments

Comments

@Nizhegorodtsev
Copy link

Nizhegorodtsev commented Feb 7, 2017

Hello!
Sorry for interrupting from development issues but I have found unexpected behaivor of LUA script when I try to call both: PUBLISH and DEL commands. I have subscriber which receive messages from specific channel about DEL events. I have found that sometimes it receive 2 notifications about same key.
After investigation I have found that there is some kind of correlation between DEL and PUBLISH commands.
I have implemented following scenarios:

  1. Call DEL script and call PUBLISH script. Expected count of notifications - 1. Actual count - 1
  2. Call PUBLISH script and call DEL script. Expected count of notifications - 1. Actual count - 1
  3. Call script to perform both: DEL and PUBLISH commands. Expected count of notifications - 1. Actual count - 2
  4. Call script to perform both: PUBLISH and DEL commands. Expected count of notifications - 1. Actual count - 2
    I'm using Redis Cluster with 3 masters and 3 slaves and redis-3.2.4

More information and screens with test results you can find here (https://groups.google.com/forum/#!topic/redis-db/dS6LacPPeKA)

Could you please clarify is it some kind of bug or I have to change the way how I'm using redis API
1 del publish
1 publish del
2 del and publish
2 publish and del

Testing scripts:
$REDIS_HOME/src/redis-cli -h xx.xx.xx.xx -p 6379 -a testpass EVAL "
local result = redis.call('DEL', KEYS[1])
redis.call('PUBLISH', ARGV[2], KEYS[1])
return result" 1 test hash REDIS.LOCK.TESTAPP

$REDIS_HOME/src/redis-cli -h xx.xx.xx.xx -p 6379 -a testpass EVAL "
redis.call('PUBLISH', ARGV[2], KEYS[1])
return redis.call('DEL', KEYS[1])" 1 test hash REDIS.LOCK.TESTAPP

$REDIS_HOME/src/redis-cli -h xx.xx.xx.xx -p 6379 -a testpass EVAL "return redis.call('DEL', KEYS[1])" 1 test hash REDIS.LOCK.TESTAPP

$REDIS_HOME/src/redis-cli -h xx.xx.xx.xx -p 6379 -a testpass EVAL "return redis.call('PUBLISH', ARGV[2], KEYS[1])" 1 test hash REDIS.LOCK.TESTAPP

Because of this issue I receive 2 notifications about LOCK removed event
3_lock

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

No branches or pull requests

1 participant