mirror of
https://github.com/fluencelabs/redis
synced 2025-04-03 00:01:04 +00:00
RESTORE: reply with -BUSYKEY special error code.
The error when the target key is busy was a generic one, while it makes sense to be able to distinguish between the target key busy error and the others easily.
This commit is contained in:
parent
2a48bd4a37
commit
5c78f87666
@ -3791,7 +3791,7 @@ void restoreCommand(redisClient *c) {
|
|||||||
|
|
||||||
/* Make sure this key does not already exist here... */
|
/* Make sure this key does not already exist here... */
|
||||||
if (!replace && lookupKeyWrite(c->db,c->argv[1]) != NULL) {
|
if (!replace && lookupKeyWrite(c->db,c->argv[1]) != NULL) {
|
||||||
addReplyError(c,"Target key name is busy.");
|
addReply(c,shared.busykeyerr);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1316,6 +1316,8 @@ void createSharedObjects(void) {
|
|||||||
"-EXECABORT Transaction discarded because of previous errors.\r\n"));
|
"-EXECABORT Transaction discarded because of previous errors.\r\n"));
|
||||||
shared.noreplicaserr = createObject(REDIS_STRING,sdsnew(
|
shared.noreplicaserr = createObject(REDIS_STRING,sdsnew(
|
||||||
"-NOREPLICAS Not enough good slaves to write.\r\n"));
|
"-NOREPLICAS Not enough good slaves to write.\r\n"));
|
||||||
|
shared.busykeyerr = createObject(REDIS_STRING,sdsnew(
|
||||||
|
"-BUSYKEY Target key name already exists.\r\n"));
|
||||||
shared.space = createObject(REDIS_STRING,sdsnew(" "));
|
shared.space = createObject(REDIS_STRING,sdsnew(" "));
|
||||||
shared.colon = createObject(REDIS_STRING,sdsnew(":"));
|
shared.colon = createObject(REDIS_STRING,sdsnew(":"));
|
||||||
shared.plus = createObject(REDIS_STRING,sdsnew("+"));
|
shared.plus = createObject(REDIS_STRING,sdsnew("+"));
|
||||||
|
@ -548,7 +548,7 @@ struct sharedObjectsStruct {
|
|||||||
*emptymultibulk, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr,
|
*emptymultibulk, *wrongtypeerr, *nokeyerr, *syntaxerr, *sameobjecterr,
|
||||||
*outofrangeerr, *noscripterr, *loadingerr, *slowscripterr, *bgsaveerr,
|
*outofrangeerr, *noscripterr, *loadingerr, *slowscripterr, *bgsaveerr,
|
||||||
*masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr,
|
*masterdownerr, *roslaveerr, *execaborterr, *noautherr, *noreplicaserr,
|
||||||
*oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
*busykeyerr, *oomerr, *plus, *messagebulk, *pmessagebulk, *subscribebulk,
|
||||||
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *rpop, *lpop,
|
*unsubscribebulk, *psubscribebulk, *punsubscribebulk, *del, *rpop, *lpop,
|
||||||
*lpush, *emptyscan, *minstring, *maxstring,
|
*lpush, *emptyscan, *minstring, *maxstring,
|
||||||
*select[REDIS_SHARED_SELECT_CMDS],
|
*select[REDIS_SHARED_SELECT_CMDS],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user