summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYossi Gottlieb <yossigo@gmail.com>2013-03-21 20:42:02 +0200
committerYossi Gottlieb <yossigo@gmail.com>2013-03-21 20:42:02 +0200
commit313a3e5703525fa43ed400519f469fc02144ff31 (patch)
treeb8af974616951ae08f49398a974ff7e8102e38ee
parent0de730ce92b5bb0e2dd3e21fdf4ce4f4c6055731 (diff)
downloadredis-2.6.10-2.tar.gz
Clear scripts when replicating from master to prevent rdbLoad from failing on duplicate scripts.2.6.10-2
-rwxr-xr-xsrc/redis.h1
-rwxr-xr-xsrc/replication.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/redis.h b/src/redis.h
index f1a8a0610..a969778d8 100755
--- a/src/redis.h
+++ b/src/redis.h
@@ -1079,6 +1079,7 @@ char *sentinelHandleConfiguration(char **argv, int argc);
/* Scripting */
void scriptingInit(void);
+void scriptingReset(void);
int luaCreateFunction(redisClient *c, lua_State *lua, char *funcname, robj *body);
/* Git SHA1 */
diff --git a/src/replication.c b/src/replication.c
index 2c83b2c30..d8283590d 100755
--- a/src/replication.c
+++ b/src/replication.c
@@ -545,6 +545,7 @@ void readSyncBulkPayload(aeEventLoop *el, int fd, void *privdata, int mask) {
redisLog(REDIS_NOTICE, "MASTER <-> SLAVE sync: Loading DB in memory");
signalFlushedDb(-1);
emptyDb();
+ scriptingReset();
/* Before loading the DB into memory we need to delete the readable
* handler, otherwise it will get called recursively since
* rdbLoad() will call the event loop to process events from time to