diff options
author | antirez <antirez@gmail.com> | 2013-06-21 12:07:53 +0200 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-06-21 12:07:53 +0200 |
commit | 515a26bbc157ca76d6e2441dd21fbac32e37bbd6 (patch) | |
tree | 4b1aff7a8362f1f9151d19b463506a04e68d790a /src/pubsub.c | |
parent | b0c2cdd6a788e736ef7b24d2a7e96e174f76365b (diff) | |
download | redis-515a26bbc157ca76d6e2441dd21fbac32e37bbd6.tar.gz |
New API to force propagation.
The old REDIS_CMD_FORCE_REPLICATION flag was removed from the
implementation of Redis, now there is a new API to force specific
executions of a command to be propagated to AOF / Replication link:
void forceCommandPropagation(int flags);
The new API is also compatible with Lua scripting, so a script that will
execute commands that are forced to be propagated, will also be
propagated itself accordingly even if no change to data is operated.
As a side effect, this new design fixes the issue with scripts not able
to propagate PUBLISH to slaves (issue #873).
Diffstat (limited to 'src/pubsub.c')
-rw-r--r-- | src/pubsub.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pubsub.c b/src/pubsub.c index add9a4c5f..a596dfc96 100644 --- a/src/pubsub.c +++ b/src/pubsub.c @@ -307,6 +307,7 @@ void punsubscribeCommand(redisClient *c) { void publishCommand(redisClient *c) { int receivers = pubsubPublishMessage(c->argv[1],c->argv[2]); if (server.cluster_enabled) clusterPropagatePublish(c->argv[1],c->argv[2]); + forceCommandPropagation(c,REDIS_PROPAGATE_REPL); addReplyLongLong(c,receivers); } |