Commit 344a065d authored by antirez's avatar antirez
Browse files

Cluster: don't propagate PUBLISH two times.

PUBLISH both published messages via Cluster bus and replication when
cluster was enabled, resulting in duplicated message in the slave.
parent 7bf7b735
...@@ -306,8 +306,10 @@ void punsubscribeCommand(redisClient *c) { ...@@ -306,8 +306,10 @@ void punsubscribeCommand(redisClient *c) {
void publishCommand(redisClient *c) { void publishCommand(redisClient *c) {
int receivers = pubsubPublishMessage(c->argv[1],c->argv[2]); int receivers = pubsubPublishMessage(c->argv[1],c->argv[2]);
if (server.cluster_enabled) clusterPropagatePublish(c->argv[1],c->argv[2]); if (server.cluster_enabled)
forceCommandPropagation(c,REDIS_PROPAGATE_REPL); clusterPropagatePublish(c->argv[1],c->argv[2]);
else
forceCommandPropagation(c,REDIS_PROPAGATE_REPL);
addReplyLongLong(c,receivers); addReplyLongLong(c,receivers);
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment