From d363299af33fefb8753c44ed554f313d0203b803 Mon Sep 17 00:00:00 2001
From: antirez <antirez@gmail.com>
Date: Wed, 19 Jun 2013 18:25:03 +0200
Subject: [PATCH] Allow writes from scripts called by AOF loading in read-only
 slaves.

This fixes issue #1163
---
 src/scripting.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/scripting.c b/src/scripting.c
index a707f1ba..b94627c7 100644
--- a/src/scripting.c
+++ b/src/scripting.c
@@ -269,6 +269,7 @@ int luaRedisGenericCommand(lua_State *lua, int raise_error) {
                 "Write commands not allowed after non deterministic commands");
             goto cleanup;
         } else if (server.masterhost && server.repl_slave_ro &&
+                   !server.loading &&
                    !(server.lua_caller->flags & REDIS_MASTER))
         {
             luaPushError(lua, shared.roslaveerr->ptr);