Commit Graph

64 Commits

Author SHA1 Message Date
antirez cd0ea1f202 Test: regression test for issue #1221. 2013-07-29 17:39:28 +02:00
antirez d5f1e4b0b5 Test: add some AOF testing to EVALSHA replication test. 2013-06-25 15:49:07 +02:00
antirez 882e36366f Test: EVALSHA replication. 2013-06-25 15:35:48 +02:00
antirez 7e5be50cbf Test: replication-3 test speedup in master-slave setup. 2013-06-25 15:13:14 +02:00
antirez f8ba3b5668 Fix comment typo in integration/aof.tcl. 2013-06-19 18:31:33 +02:00
antirez ca35de1d1f Test: avoid a false positive in min-slaves test. 2013-05-31 11:43:30 +02:00
antirez 434a86dbd8 Tests added for min-slaves feature. 2013-05-30 18:54:28 +02:00
antirez d64d2e21c9 Make tests compatible with new INFO replication output. 2013-05-30 11:43:43 +02:00
antirez e938575220 Test: more PSYNC tests (backlog TTL). 2013-05-09 12:52:04 +02:00
antirez 16f2c3ea14 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 c87dd0fe49 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 c4656119b6 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 4ed2581a92 Test: split conceptually unrelated comments in RDB test. 2013-04-22 11:25:49 +02:00
antirez ae94fe7e48 Test: make sure broken RDB checksum is detected. 2013-03-13 11:12:45 +01:00
antirez 82b0eae690 Test: more RDB loading checks.
A test for issue #1001 is included.
2013-03-13 10:04:33 +01:00
antirez 0b74a85678 Test: check that Redis starts empty without an RDB file. 2013-03-12 19:55:33 +01:00
Johan Bergström 1154283577 Use `info nameofexectuable` to find current executable 2013-01-24 09:37:18 +11:00
antirez 7eb850ef0e 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 d9241b35e5 Properly wait the slave to sync with master in BRPOPLPUSH test. 2012-04-30 10:55:03 +02:00
antirez 2d4b55214f A more lightweight implementation of issue 141 regression test. 2012-04-29 17:16:44 +02:00
antirez 28ccb53008 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 875944a23f 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 459e2975f4 On slow computers, 10 seconds are not enough for this heavy replication test. 2012-04-04 19:54:23 +02:00
antirez 22c9c4076b Regression test for issue 417 (memory leak when replicating to DB with id >= 10) 2012-03-30 10:26:07 +02:00
antirez 512f682340 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 6c658d5554 Contextualize comment. 2012-03-23 20:24:40 +01:00
antirez 03116904c3 RDB load of different encodings test added. 2012-03-23 20:24:30 +01:00
antirez 8562798308 Merge conflicts resolved. 2012-03-09 22:07:45 +01:00
Pieter Noordhuis 80586cb894 Test that zipmap from RDB is correctly converted 2012-01-25 13:28:11 -08:00
antirez 06312eed86 Possible fix for false positives in issue 141 regression test 2012-01-12 16:24:54 +01:00
antirez 414c3deac1 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 954cc9d0f6 Redis test: vaoid two false positives while running under valgrind. 2011-12-10 13:28:32 +01:00
antirez 43093dff2d 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 c0875a77a1 Regression test for issue #142 added 2011-10-17 10:41:46 +02:00
Pieter Noordhuis 3aa4b00970 Failing test related to AOF rewrite buffers 2011-09-16 11:25:05 +02:00
antirez 4c378d7f6c new test engine valgrind support 2011-07-11 13:41:06 +02:00
antirez 30cf7be60c the test runs less iterations of slow tests if no --accurate is given. 2011-07-11 12:15:35 +02:00
antirez 569f84aa7c 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 5521fa6a9f 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 72bae0cc75 Add test for incorrect expiration when loading AOF. 2011-07-07 16:08:22 +02:00
antirez c1c9d551da Fix for bug 561 and other related problems 2011-06-20 17:19:36 +02:00
antirez 27fee630f5 Comment typo fixed 2011-05-24 10:43:35 +02:00
antirez 70bc5f7724 replication with expire test modified to produce no or less false failures 2011-05-12 20:21:43 +02:00
Pieter Noordhuis 45b0f6fb14 Use correct argc/argv for cleanup when loading AOF 2011-04-22 09:44:06 +02:00
Pieter Noordhuis d8b6ae3cd6 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