587 Commits

Author SHA1 Message Date
Matt Stancliff
7fc1fc8ca7 Fix blocking operations from missing new lists
Behrad Zari discovered [1] and Josiah reported [2]: if you block
and wait for a list to exist, but the list creates from
a non-push command, the blocked client never gets notified.

This commit adds notification of blocked clients into
the DB layer and away from individual commands.

Lists can be created by [LR]PUSH, SORT..STORE, RENAME, MOVE,
and RESTORE.  Previously, blocked client notifications were
only triggered by [LR]PUSH.  Your client would never get
notified if a list were created by SORT..STORE or RENAME or
a RESTORE, etc.

Blocked client notification now happens in one unified place:
  - dbAdd() triggers notification when adding a list to the DB

Two new tests are added that fail prior to this commit.

All test pass.

Fixes #1668

[1]: https://groups.google.com/forum/#!topic/redis-db/k4oWfMkN1NU
[2]: #1668
2014-06-09 11:38:55 +02:00
yoav
a20d5c50d0 Fix eval usage in tests to conform with eval semantics 2014-06-06 10:44:04 +02:00
antirez
cfe2d563bc Tests for min-slaves-* feature. 2014-06-05 10:50:32 +02:00
antirez
b71720772e Regression test for issue #1118. 2014-06-04 18:51:33 +02:00
antirez
53bc8a77d1 Cluster test: add tmp dir to Git repo. 2014-05-26 18:06:48 +02:00
Matt Stancliff
033d717295 Fix test framework to detect proper server PID
Previously the PID format was:
[PID] Timestamp

But it recently changed to:
PID:X Timestamp

The tcl testing framework was grabbing the PID from \[\d+\], but
that's not valid anymore.

Now we grab the pid from "PID: <PID>" in the part of Redis startup
output to the right of the ASCII logo.
2014-05-26 17:58:49 +02:00
antirez
672e2672aa Cluster test: catch FLUSHALL errors on node reset.
FLUSHALL will fail on read-only slaves, but there the command is not
needed in order to reset the instance with CLUSTER RESET so errors can
be ignored.
2014-05-26 16:36:11 +02:00
antirez
7f8ea7a50f Cluster test: basic failover unit added. 2014-05-23 15:54:53 +02:00
antirez
29aed9c48f Cluster test: move basic read/write test into a procedure. 2014-05-23 15:54:53 +02:00
antirez
81af783fec Cluster test: more reliable 01-faildet unit.
Do things in a sequence that prevents failover during failure detection.
2014-05-23 15:54:53 +02:00
antirez
308c570e04 Test: AOF test false positive when running in slow hosts.
The bug was triggered by running the test with Valgrind (which is a lot
slower and more sensible to timing issues) after the recent changes
that made Redis more promptly able to reply with the -LOADING error.
2014-05-23 09:26:04 +02:00
antirez
1d70312028 Test: dump.tcl fixed for RESTORE new error msg. 2014-05-23 09:26:04 +02:00
antirez
122157f220 Regression test for issue #1764. 2014-05-20 17:45:50 +02:00
antirez
440ee603b7 Cluster test: better failure detection test and framework improvements. 2014-05-20 17:45:50 +02:00
antirez
a7fd2eb594 Cluster test: failure detection initial tests. 2014-05-20 17:45:50 +02:00
antirez
a82c000bdb Cluster test: proper initialization at unit startup. 2014-05-20 17:45:50 +02:00
antirez
d279024081 Cluster test: added function assert_cluster_state. 2014-05-20 17:45:50 +02:00
antirez
f727000f0c cluster.tcl: fix redis links leak in refresh_nodes_map. 2014-05-20 17:45:49 +02:00
antirez
4db4a5d5d6 cluster.tcl: saner error handling.
Better handling of connection errors in order to update the table and
recovery, populate the startup nodes table after fetching the list of
nodes.

More work to do about it, it is still not as reliable as
redis-rb-cluster implementation which is the minimal reference
implementation for Redis Cluster clients.
2014-05-20 17:45:49 +02:00
antirez
d9227938c8 redis.tcl: return I/O error message when peer closes connection. 2014-05-20 17:45:49 +02:00
antirez
26eb7ec731 HyperLogLog regression test for issue #1762. 2014-05-19 15:45:22 +02:00
antirez
35b94422f6 Scripting test: check that Lua can call commands rewirting argv.
SPOP, tested in the new test, is among the commands rewritng the
client->argv argument vector (it gets rewritten as SREM) for command
replication purposes.

Because of recent optimizations to client->argv caching in the context
of the Lua internal Redis client, it is important to test for SPOP to be
callable from Lua without bad effects to the other commands.
2014-05-07 16:12:38 +02:00
antirez
1255460c96 Test: handle new osx 'leaks' error.
Sometimes the process is still there but no longer in a state that can
be checked (after being killed). This used to happen after a call to
SHUTDOWN NOSAVE in the scripting unit, causing a false positive.
2014-05-07 16:12:38 +02:00
antirez
402b1170bc Test: cluster/base, check that we can write/read from cluster. 2014-05-05 09:37:39 +02:00
antirez
f188fa4a15 Cluster: Tcl cluster client: handle MOVED/ASK. 2014-05-05 09:37:39 +02:00
antirez
5069e0b9cd Cluster: Tcl cluster client: slots-nodes map and close method.
Now the client is able to actually run commands in a Redis Cluster
assuming the slots->nodes map is stable.
2014-05-05 09:37:39 +02:00
antirez
9fe28612b9 Cluster: Tcl cluster client: build nodes representation. 2014-05-05 09:37:39 +02:00
antirez
a5b7065bdf Cluster: Tcl cluster client: get nodes description. 2014-05-05 09:37:39 +02:00
antirez
1826167519 Cluster: Tcl cluster client key -> hashslot. 2014-05-05 09:37:39 +02:00
antirez
43570e9319 Cluster test: Tcl cluster library initial skeleton. 2014-05-05 09:37:39 +02:00
antirez
4ca7c5bcde Cluster test: check for state=ok after slot allocation. 2014-05-05 09:37:39 +02:00
antirez
6fc17adcd8 Cluster test: slots allocation. 2014-05-05 09:37:39 +02:00
antirez
0906ca8a3e Cluster test: use 20 instances.
This makes tests a bit slower, but it is better to test things at a
decent scale instead of using just a few nodes, and for a few tests we
actually need so many nodes.
2014-05-05 09:37:39 +02:00
antirez
402815cc3f Cluster / Sentinel test: instances count moved to run.tcl. 2014-05-05 09:37:39 +02:00
antirez
6e60e2467b Cluster test: config epoch conflict resolution. 2014-05-05 09:37:39 +02:00
antirez
b1f6f2ace0 Cluster test: auto-discovery to form full mesh. 2014-05-05 09:37:39 +02:00
antirez
e244bee60c Cluster test: check that every node has a different ID. 2014-05-05 09:37:39 +02:00
antirez
6b4e9558bd Cluster test: basic cluster nodes info access functions. 2014-05-05 09:37:39 +02:00
antirez
eeab60d1d5 Test: fixed scripting.tcl test false positive. 2014-04-28 18:17:02 +02:00
antirez
a8464828b6 Redis Cluster test framework skeleton. 2014-04-28 18:17:02 +02:00
antirez
a0050e5030 Sentinel test files / directories layout improved.
The test now runs in a self-contained directory.
The general abstractions to run the tests in an environment where
mutliple instances are executed at the same time was extrapolated into
instances.tcl, that will be reused to test Redis Cluster.
2014-04-28 18:17:02 +02:00
antirez
3bff0291d8 Test: spawn_instance now supports additional config. 2014-04-28 18:17:02 +02:00
Matt Stancliff
08174e730f Add test for deleting an expired key
Verify proper expire-before-delete behavior.

This test passes with the expire-before-delete commit and fails
without it.
2014-04-23 16:14:34 +02:00
antirez
aff94a706e Fuzzy test for ZREMRANGEBYLEX added. 2014-04-18 16:14:34 +02:00
antirez
ca6c793844 PFCOUNT multi-key test added. 2014-04-18 16:14:34 +02:00
antirez
53ca563ff7 Sorted set lex ranges stress tester. 2014-04-18 16:14:34 +02:00
antirez
5e1224dc1d Basic ZRANGEBYLEX / ZLEXCOUNT tests. 2014-04-17 00:08:35 +02:00
antirez
00aa96f34b More HyperLogLog tests. 2014-04-16 15:09:47 +02:00
antirez
fdace9bc50 PFMERGE fixed to work with sparse encoding. 2014-04-16 15:09:47 +02:00
antirez
e0389f031e Initial HyperLogLog tests. 2014-04-16 15:09:45 +02:00