64 Commits

Author SHA1 Message Date
antirez
1b26e3e1fa Test: regression test for issue #1221. 2013-07-29 17:39:28 +02:00
antirez
600567383a Test: add some AOF testing to EVALSHA replication test. 2013-06-25 15:49:07 +02:00
antirez
1ff422dc47 Test: EVALSHA replication. 2013-06-25 15:35:48 +02:00
antirez
c43286e5a9 Test: replication-3 test speedup in master-slave setup. 2013-06-25 15:13:14 +02:00
antirez
96574ee610 Fix comment typo in integration/aof.tcl. 2013-06-19 18:31:33 +02:00
antirez
650fc5218f Test: avoid a false positive in min-slaves test. 2013-05-31 11:43:30 +02:00
antirez
89ec3e8b22 Tests added for min-slaves feature. 2013-05-30 18:54:28 +02:00
antirez
376797e1b5 Make tests compatible with new INFO replication output. 2013-05-30 11:43:43 +02:00
antirez
020b660322 Test: more PSYNC tests (backlog TTL). 2013-05-09 12:52:04 +02:00
antirez
78abe60d77 Test: check that replication partial sync works if we break the link.
The test checks both successful syncs and unsuccessful ones by changing
the backlog size.
2013-05-08 13:01:44 +02:00
antirez
3a649224bd Test: various issues with the replication-4.tcl test fixed.
The test actually worked, but vars for master and slave were inverted
and sometimes used incorrectly.
2013-05-08 11:58:26 +02:00
antirez
de5e085f1f Test: fix RDB test checking file permissions.
When the test is executed using the root account, setting the permission
to 222 does not work as expected, as root can read files with 222
permission.

Now we skip the test if root is detected.

This fixes issue #1034 and the duplicated #1040 issue.

Thanks to Jan-Erik Rediger (@badboy on Github) for finding a way to reproduce the issue.
2013-04-23 14:16:50 +02:00
antirez
971d6b329d Test: split conceptually unrelated comments in RDB test. 2013-04-22 11:25:49 +02:00
antirez
dec5a0bde9 Test: make sure broken RDB checksum is detected. 2013-03-13 11:12:45 +01:00
antirez
d42f82488d Test: more RDB loading checks.
A test for issue #1001 is included.
2013-03-13 10:04:33 +01:00
antirez
7614cf793d Test: check that Redis starts empty without an RDB file. 2013-03-12 19:55:33 +01:00
Johan Bergström
5d22ef818a Use info nameofexectuable to find current executable 2013-01-24 09:37:18 +11:00
antirez
8574733f48 A reimplementation of blocking operation internals.
Redis provides support for blocking operations such as BLPOP or BRPOP.
This operations are identical to normal LPOP and RPOP operations as long
as there are elements in the target list, but if the list is empty they
block waiting for new data to arrive to the list.

All the clients blocked waiting for th same list are served in a FIFO
way, so the first that blocked is the first to be served when there is
more data pushed by another client into the list.

The previous implementation of blocking operations was conceived to
serve clients in the context of push operations. For for instance:

1) There is a client "A" blocked on list "foo".
2) The client "B" performs `LPUSH foo somevalue`.
3) The client "A" is served in the context of the "B" LPUSH,
synchronously.

Processing things in a synchronous way was useful as if "A" pushes a
value that is served by "B", from the point of view of the database is a
NOP (no operation) thing, that is, nothing is replicated, nothing is
written in the AOF file, and so forth.

However later we implemented two things:

1) Variadic LPUSH that could add multiple values to a list in the
context of a single call.
2) BRPOPLPUSH that was a version of BRPOP that also provided a "PUSH"
side effect when receiving data.

This forced us to make the synchronous implementation more complex. If
client "B" is waiting for data, and "A" pushes three elemnents in a
single call, we needed to propagate an LPUSH with a missing argument
in the AOF and replication link. We also needed to make sure to
replicate the LPUSH side of BRPOPLPUSH, but only if in turn did not
happened to serve another blocking client into another list ;)

This were complex but with a few of mutually recursive functions
everything worked as expected... until one day we introduced scripting
in Redis.

Scripting + synchronous blocking operations = Issue #614.

Basically you can't "rewrite" a script to have just a partial effect on
the replicas and AOF file if the script happened to serve a few blocked
clients.

The solution to all this problems, implemented by this commit, is to
change the way we serve blocked clients. Instead of serving the blocked
clients synchronously, in the context of the command performing the PUSH
operation, it is now an asynchronous and iterative process:

1) If a key that has clients blocked waiting for data is the subject of
a list push operation, We simply mark keys as "ready" and put it into a
queue.
2) Every command pushing stuff on lists, as a variadic LPUSH, a script,
or whatever it is, is replicated verbatim without any rewriting.
3) Every time a Redis command, a MULTI/EXEC block, or a script,
completed its execution, we run the list of keys ready to serve blocked
clients (as more data arrived), and process this list serving the
blocked clients.
4) As a result of "3" maybe more keys are ready again for other clients
(as a result of BRPOPLPUSH we may have push operations), so we iterate
back to step "3" if it's needed.

The new code has a much simpler semantics, and a simpler to understand
implementation, with the disadvantage of not being able to "optmize out"
a PUSH+BPOP as a No OP.

This commit will be tested with care before the final merge, more tests
will be added likely.
2012-09-17 10:26:46 +02:00
antirez
30d3fc3024 Properly wait the slave to sync with master in BRPOPLPUSH test. 2012-04-30 10:55:03 +02:00
antirez
9f97d57184 A more lightweight implementation of issue 141 regression test. 2012-04-29 17:16:44 +02:00
antirez
53e898d3f1 Redis test: More reliable BRPOPLPUSH replication test.
Now it uses the new wait_for_condition testing primitive.
Also wait_for_condition implementation was fixed in this commit to properly
escape the expr command and its argument.
2012-04-26 11:25:13 +02:00
Michael Schlenker
00ed1334f7 Replace unnecessary calls to echo and cat
Tcl's exec can send data to stdout itself, no need to call cat/echo for
that usually.
2012-04-17 22:20:54 +02:00
antirez
a95fb8ebe2 On slow computers, 10 seconds are not enough for this heavy replication test. 2012-04-04 19:54:23 +02:00
antirez
b3b02de664 Regression test for issue 417 (memory leak when replicating to DB with id >= 10) 2012-03-30 10:26:07 +02:00
antirez
44a5424640 convert-zipmap-hash-on-load false positive fixed.
Apparently because the sample RDB file was not copied before every test
Redis had a chance to replace it with a newly written one, so that the
next test could fail.
2012-03-25 11:02:16 +02:00
antirez
4c955a5715 Contextualize comment. 2012-03-23 20:24:40 +01:00
antirez
251268cbe0 RDB load of different encodings test added. 2012-03-23 20:24:30 +01:00
antirez
afadac1728 Merge conflicts resolved. 2012-03-09 22:07:45 +01:00
Pieter Noordhuis
a40390001d Test that zipmap from RDB is correctly converted 2012-01-25 13:28:11 -08:00
antirez
7b85752db0 Possible fix for false positives in issue 141 regression test 2012-01-12 16:24:54 +01:00
antirez
4f69e70bcd Regression test for the main problem causing issue #141. Minor changes/fixes/additions to the test suite itself needed to write the test. 2012-01-06 17:28:40 +01:00
antirez
d7c54f2cbb Redis test: vaoid two false positives while running under valgrind. 2011-12-10 13:28:32 +01:00
antirez
4ed1ed71d2 Redis test: two redundant tests removed as they tend to create issues when running the test with valgrind. 2011-12-07 18:31:39 +01:00
antirez
a9dedd0d88 Regression test for issue #142 added 2011-10-17 10:41:46 +02:00
Pieter Noordhuis
a9f7a179fd Failing test related to AOF rewrite buffers 2011-09-16 11:25:05 +02:00
antirez
2840d1652f new test engine valgrind support 2011-07-11 13:41:06 +02:00
antirez
d801f7a4be the test runs less iterations of slow tests if no --accurate is given. 2011-07-11 12:15:35 +02:00
antirez
818df58b14 replication test split into three parts in order to improve test execution time. Random fixes and improvements. 2011-07-11 00:46:25 +02:00
antirez
226647908e Test for regression about: Redis should not try to convert DEL into EXPIREAT for EXPIRE -1 2011-07-08 12:20:30 +02:00
Hampus Wessman
703565b93c Add test for incorrect expiration when loading AOF. 2011-07-07 16:08:22 +02:00
antirez
7192cd5cb7 Fix for bug 561 and other related problems 2011-06-20 17:19:36 +02:00
antirez
1ebc86e1d7 Comment typo fixed 2011-05-24 10:43:35 +02:00
antirez
34a2a40c0c replication with expire test modified to produce no or less false failures 2011-05-12 20:21:43 +02:00
Pieter Noordhuis
ded49d96bb Use correct argc/argv for cleanup when loading AOF 2011-04-22 09:44:06 +02:00
Pieter Noordhuis
856c5dc498 Reformat AOF tests 2011-04-22 09:43:26 +02:00
Pieter Noordhuis
b4b62c34db Use fstat to detect if stdin was redirected 2010-08-25 14:48:50 +02:00
Pieter Noordhuis
f791d66e20 Make helper functions simpler 2010-08-25 14:15:41 +02:00
Pieter Noordhuis
f9b252613b Comments in redis-cli tests 2010-08-25 14:08:32 +02:00
Pieter Noordhuis
ae77016e57 Add a newline to tty output after every reply 2010-08-25 13:39:11 +02:00
Pieter Noordhuis
4b93e5e267 Merge master and move argument splitting patch to sds.c 2010-08-25 13:08:43 +02:00