From b02bb47e67858bcac25c3d2e4f726e5aa164c9f6 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 19 Jun 2013 18:53:07 +0200 Subject: [PATCH] Test: regression test for #1163. --- tests/unit/scripting.tcl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tests/unit/scripting.tcl b/tests/unit/scripting.tcl index e42f8772..3e08f630 100644 --- a/tests/unit/scripting.tcl +++ b/tests/unit/scripting.tcl @@ -281,6 +281,23 @@ start_server {tags {"scripting"}} { assert_equal $rand1 $rand2 assert {$rand2 ne $rand3} } + + test {EVAL processes writes from AOF in read-only slaves} { + r flushall + r config set appendonly yes + r eval {redis.call("set","foo","100")} 0 + r eval {redis.call("incr","foo")} 0 + r eval {redis.call("incr","foo")} 0 + wait_for_condition 50 100 { + [s aof_rewrite_in_progress] == 0 + } else { + fail "AOF rewrite can't complete after CONFIG SET appendonly yes." + } + r config set slave-read-only yes + r slaveof 127.0.0.1 0 + r debug loadaof + r get foo + } {102} } # Start a new server since the last test in this stanza will kill the