mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 16:51:22 +00:00
Use the new unified protocol to send SELECT to slaves.
SELECT was still transmitted to slaves using the inline protocol, that is conceived mostly for humans to type into telnet sessions, and is notably not understood by redis-cli --slave. Now the new protocol is used instead.
This commit is contained in:
@ -61,8 +61,14 @@ void replicationFeedSlaves(list *slaves, int dictid, robj **argv, int argc) {
|
||||
selectcmd = shared.select[dictid];
|
||||
incrRefCount(selectcmd);
|
||||
} else {
|
||||
char dictid_str[64];
|
||||
int dictid_len;
|
||||
|
||||
dictid_len = ll2string(dictid_str,sizeof(dictid_str),dictid);
|
||||
selectcmd = createObject(REDIS_STRING,
|
||||
sdscatprintf(sdsempty(),"select %d\r\n",dictid));
|
||||
sdscatprintf(sdsempty(),
|
||||
"*2\r\n$6\r\nSELECT\r\n$%d\r\n%s\r\n",
|
||||
dictid_len, dictid_str));
|
||||
}
|
||||
addReply(slave,selectcmd);
|
||||
decrRefCount(selectcmd);
|
||||
|
Reference in New Issue
Block a user