summaryrefslogtreecommitdiff
path: root/src/redis.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/redis.c')
-rw-r--r--src/redis.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/redis.c b/src/redis.c
index d68837500..767411758 100644
--- a/src/redis.c
+++ b/src/redis.c
@@ -221,6 +221,7 @@ struct redisCommand redisCommandTable[] = {
{"multi",multiCommand,1,"rs",0,NULL,0,0,0,0,0},
{"exec",execCommand,1,"sM",0,NULL,0,0,0,0,0},
{"discard",discardCommand,1,"rs",0,NULL,0,0,0,0,0},
+ {"minreplicas",minreplicasCommand,3,"rs",0,NULL,0,0,0,0,0},
{"sync",syncCommand,1,"ars",0,NULL,0,0,0,0,0},
{"psync",syncCommand,3,"ars",0,NULL,0,0,0,0,0},
{"replconf",replconfCommand,-1,"ars",0,NULL,0,0,0,0,0},
@@ -1112,6 +1113,18 @@ void beforeSleep(struct aeEventLoop *eventLoop) {
}
}
+ /* Request ACK to slaves if we have pending MINREPLICAS transactions. */
+ if (server.repl_request_ack) {
+ repl_request_ack = 0;
+ robj *argv[2];
+
+ argv[0] = createStringObject("REPLCONF",8);
+ argv[1] = createStrinbObject("SENDACK",7);
+ replicationFeedSlaves(server.slaves, server.slaveseldb, argv, 2);
+ decrRefCount(ping_argv[0]);
+ decrRefCount(ping_argv[1]);
+ }
+
/* Write the AOF buffer on disk */
flushAppendOnlyFile(0);
}