mirror of
https://github.com/fluencelabs/redis
synced 2025-06-18 03:31:21 +00:00
slave corrupts replication stream when module blocked client uses large reply (or POSTPONED_ARRAY)
when redis appends the blocked client reply list to the real client, it didn't bother to check if it is in fact the master client. so a slave executing that module command will send replies to the master, causing the master to send the slave error responses, which will mess up the replication offset (slave will advance it's replication offset, and the master does not)
This commit is contained in:
@ -3747,12 +3747,7 @@ void moduleHandleBlockedClients(void) {
|
||||
* We need to glue such replies to the client output buffer and
|
||||
* free the temporary client we just used for the replies. */
|
||||
if (c) {
|
||||
if (bc->reply_client->bufpos)
|
||||
addReplyProto(c,bc->reply_client->buf,
|
||||
bc->reply_client->bufpos);
|
||||
if (listLength(bc->reply_client->reply))
|
||||
listJoin(c->reply,bc->reply_client->reply);
|
||||
c->reply_bytes += bc->reply_client->reply_bytes;
|
||||
AddReplyFromClient(c, bc->reply_client);
|
||||
}
|
||||
freeClient(bc->reply_client);
|
||||
|
||||
|
Reference in New Issue
Block a user