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

Error response is not forward to client on redis mulit del command #216

Open
idning opened this issue Apr 22, 2014 · 3 comments
Open

Error response is not forward to client on redis mulit del command #216

idning opened this issue Apr 22, 2014 · 3 comments

Comments

@idning
Copy link
Contributor

idning commented Apr 22, 2014

if one of the redis server is read only slave:

del key1 will got Err:

READONLY You can't write against a read only slave.

del key1 key2 key3 will got Err:

Invalid argument

here is the test case:

def test_multi_delete_on_readonly():
    all_redis = [
            RedisServer(USER, '127.0.0.5:2100', '/tmp/r/redis-2100/'),
            RedisServer(USER, '127.0.0.5:2101', '/tmp/r/redis-2101/'),
        ]
    for r in all_redis:
        r.args['cluster_name'] = 'ttt'
        r.args['server_name'] = TT('redis-$port', r.args)
        r.deploy()
        r.start()

    nc = NutCracker(USER, '127.0.0.5:4100', '/tmp/r/nutcracker-4100/', all_redis)
    nc.args['cluster_name'] = 'ttt'
    nc.deploy()
    nc.start()


    all_redis[0].slaveof(all_redis[1].args['host'], all_redis[1].args['port'])
    r = redis.Redis('127.0.0.5', 4100)
    keys = ['key-1', 'key-2', 'kkk-3']

    r.delete('key-1') #got READONLY You can't write against a read only slave.
    r.delete('key-2')
    r.delete('key-3')
    print r.delete(*keys) #got Invalid argument

here is the code make this different:

https://github.com/twitter/twemproxy/blob/master/src/proto/nc_redis.c#L2063-L2074

@idning idning mentioned this issue Apr 22, 2014
@idning
Copy link
Contributor Author

idning commented Apr 22, 2014

@manjuraj
Copy link
Collaborator

@idning is this still an issue?

@idning
Copy link
Contributor Author

idning commented Dec 16, 2014

@manjuraj when we want to do a multi-del on many keys, and one of the redis-servers is READONLY.

some of the keys will be deleted success. but what we return to client is "Invalid argument", this is not good.

I think return READONLY is somehow better. so this is still a problem we need to solve.

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

2 participants