1238 Commits

Author SHA1 Message Date
John Sully
bb9b8ee164 Fix bad merge in SCAN KEYS command
Former-commit-id: c21af6b351328ffbdb1d1e2a7eed44f8f929f8b2
2019-07-19 00:43:23 -04:00
John Sully
73df5494a8 Merge commit 'bf963253ecfd367b49081a26c1b5c410558aecfc' into unstable
Former-commit-id: 10986ae3a801c13013ec74880dd1f7969c284d01
2019-07-18 23:22:36 -04:00
antirez
dec2345007 Test: fix slowlog test false positive.
In fast systems "SLOWLOG RESET" is fast enough to don't be logged even
when the time limit is "1" sometimes. Leading to false positives such
as:

[err]: SLOWLOG - can be disabled in tests/unit/slowlog.tcl
Expected '1' to be equal to '0'


Former-commit-id: 8198a697fd4455c88712099f20632e554fb564d4
2019-07-18 23:12:52 -04:00
antirez
b70266f3d3 Fix test false positive introduced by threaded I/O.
Now clients that are ready to be terminated asynchronously are processed
more often in beforeSleep() instead of being processed in serverCron().
This means that the test will not be able to catch the moment the client
was terminated, also note that the 'omem' figure now changes in big
steps, because of the new client output buffers layout.

So we have to change the test range in order to accomodate for that.
Yet the test is useful enough to be worth taking, even if its precision
is reduced by this commit. Probably if we get more problems, a thing
that makes sense is just to check that the limit is < 200k. That's more
than enough actually.


Former-commit-id: 8aaa8b0b116dc86473b6a94bf2ff330dd4163ca1
2019-07-18 23:12:05 -04:00
John Sully
727bda7108 remove unnecessary variables
Former-commit-id: a9c4e3970fd0d00896cb5500b2cc926ec3177bc4
2019-07-18 19:37:49 -04:00
John Sully
2110b84f7e Fix issue #59 - Test replicaof config variable
Former-commit-id: d5ecc2347a717f6e6f938d81325476a9c3dff9a6
2019-07-18 19:22:49 -04:00
Oran Agra
c56b4ddc6f prevent diskless replica from terminating on short read
now that replica can read rdb directly from the socket, it should avoid exiting
on short read and instead try to re-sync.

this commit tries to have minimal effects on non-diskless rdb reading.
and includes a test that tries to trigger this scenario on various read cases.
2019-07-17 16:46:22 +02:00
Oran Agra
56258c6b7d Module API for Forking
* create module API for forking child processes.
* refactor duplicate code around creating and tracking forks by AOF and RDB.
* child processes listen to SIGUSR1 and dies exitFromChild in order to
  eliminate a valgrind warning of unhandled signal.
* note that BGSAVE error reply has changed.

valgrind error is:
  Process terminating with default action of signal 10 (SIGUSR1)
2019-07-17 16:40:24 +03:00
Salvatore Sanfilippo
4b2579a064
Merge pull request #5779 from madolson/dev-unstable-geo-bugfix
Fixed a rounding bug in geo.tcl
2019-07-15 23:41:57 +02:00
John Sully
0dd9a27420 Give the active-rep more time to sync for test reliability
Former-commit-id: 620c2ec1412a3bcea5fecf21238caa065e73f3e9
2019-07-12 23:52:07 -04:00
John Sully
03d41318b0 Add Active Replication tests
Former-commit-id: 528d10091fda0d2c56674e825c4f70467587955f
2019-07-12 03:54:41 -04:00
John Sully
42143ac654 FIX: The dabase count configuration is not respected
Former-commit-id: 149c3cf3dd75e8058c7c560d6a7ffbbb95da3898
2019-07-12 02:13:37 -04:00
Oran Agra
2de544cfcc diskless replication on slave side (don't store rdb to file), plus some other related fixes
The implementation of the diskless replication was currently diskless only on the master side.
The slave side was still storing the received rdb file to the disk before loading it back in and parsing it.

This commit adds two modes to load rdb directly from socket:
1) when-empty
2) using "swapdb"
the third mode of using diskless slave by flushdb is risky and currently not included.

other changes:
--------------
distinguish between aof configuration and state so that we can re-enable aof only when sync eventually
succeeds (and not when exiting from readSyncBulkPayload after a failed attempt)
also a CONFIG GET and INFO during rdb loading would have lied

When loading rdb from the network, don't kill the server on short read (that can be a network error)

Fix rdb check when performed on preamble AOF

tests:
run replication tests for diskless slave too
make replication test a bit more aggressive
Add test for diskless load swapdb
2019-07-08 15:37:48 +03:00
John Sully
87d57aa265 lazyfree needs to consume more memory to be detectable
Former-commit-id: 122ec25bf0db0b90e7789b1ab90695ac3f9258b7
2019-07-06 00:53:40 -04:00
John Sully
a686622540 We can use less memory in the client output buffers. Its OK
Former-commit-id: 852819180f6a281449a376b6b79a424af4e63c82
2019-07-05 23:43:01 -04:00
Angus Pearson
bf963253ec Implement SCAN cursor [TYPE type] modifier suggested in issue #6107.
Add tests to check basic functionality of this optional keyword, and also tested with
a module (redisgraph). Checked quickly with valgrind, no issues.

Copies name the type name canonicalisation code from `typeCommand`, perhaps this would
be better factored out to prevent the two diverging and both needing to be edited to
add new `OBJ_*` types, but this is a little fiddly with C strings.

The [redis-doc](https://github.com/antirez/redis-doc/blob/master/commands.json) repo
will need to be updated with this new arg if accepted.

A quirk to be aware of here is that the GEO commands are backed by zsets not their own
type, so they're not distinguishable from other zsets.

Additionally, for sparse types this has the same behaviour as `MATCH` in that it may
return many empty results before giving something, even for large `COUNT`s.
2019-05-22 16:39:04 +01:00
antirez
1a1ba48390 Test: fix slowlog test false positive.
In fast systems "SLOWLOG RESET" is fast enough to don't be logged even
when the time limit is "1" sometimes. Leading to false positives such
as:

[err]: SLOWLOG - can be disabled in tests/unit/slowlog.tcl
Expected '1' to be equal to '0'
2019-05-14 16:55:52 +02:00
antirez
4f4676a142 Fix test false positive introduced by threaded I/O.
Now clients that are ready to be terminated asynchronously are processed
more often in beforeSleep() instead of being processed in serverCron().
This means that the test will not be able to catch the moment the client
was terminated, also note that the 'omem' figure now changes in big
steps, because of the new client output buffers layout.

So we have to change the test range in order to accomodate for that.
Yet the test is useful enough to be worth taking, even if its precision
is reduced by this commit. Probably if we get more problems, a thing
that makes sense is just to check that the limit is < 200k. That's more
than enough actually.
2019-05-13 17:27:10 +02:00
John Sully
25a904605a Make lazy free test more reliable
Former-commit-id: 54d6eb851bbea48e858d84bca818cb14c65b6403
2019-05-11 17:57:35 -04:00
John Sully
e48c132d35 Merge branch 'unstable' of https://github.com/antirez/redis into MergeRedis
Note: some tests failing

Former-commit-id: 86d7276f24f0cf1a0eceb6cd00a6a0ae2a0fa520
2019-05-11 02:20:34 -04:00
zhaozhao.zz
c64aec9ce7 test cases: skiptill -> skip-till 2019-05-10 16:27:25 +08:00
Oran Agra
ba809f26d4 make replication tests more stable on slow machines
solving few replication related tests race conditions which fail on slow machines

bugfix in slave buffers test: since the test is executed twice, each time with
a different commands count, the threshold for the delta can't be a constant.
2019-05-05 08:25:01 +03:00
Salvatore Sanfilippo
d044e33c20
Merge pull request #5961 from yossigo/modules-tests
Modules tests
2019-04-11 07:56:23 -07:00
antirez
c24e32041b ACL: Fix memory leak in ACLResetSubcommandsForCommand().
This commit fixes bug reported at #5998. Thanks to @tomcat1102.
2019-04-08 18:08:37 +02:00
antirez
f8a9708aa7 ACL: regression test for #5998. 2019-04-08 18:06:50 +02:00
John Sully
2fef83aa60 Fix some more failing tests
Former-commit-id: cd836a37e74e4fdf3bbe49f1697c68e6db4eb20a
2019-04-04 00:25:30 -04:00
John Sully
a7ed7e06a8 Merge branch 'unstable' into wip-multimaster
Former-commit-id: 4326d22380e4e4d9491c4b7cd050b26ec49663b3
2019-04-03 00:12:13 -04:00
John Sully
c40779752e Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: 3745bbd95b16d7134c86143f458d7f31168c7d33
2019-04-03 00:00:38 -04:00
John Sully
55696f4436 Tests are passing! YAY!
Former-commit-id: e300f753c58fc542267536cd90c1a6b970d83539
2019-04-02 21:36:04 -04:00
John Sully
422ac66531 Make PSYNC2 tests more reliable on slower hardware
Former-commit-id: 7b1dd0b60d0d65baa43cb69457e06744e0d9094f
2019-03-26 18:59:31 -04:00
Yossi Gottlieb
ec0b6bd2c3 Add runtest-moduleapi with commandfilter coverage. 2019-03-24 12:03:03 +02:00
Yossi Gottlieb
822a992f91 fix: missing initialization. 2019-03-24 12:00:33 +02:00
Yossi Gottlieb
6c0a5fde3d CommandFilter API: REDISMODULE_CMDFILTER_NOSELF.
Add a flag to automatically protect filters from being called
recursively by their own module.
2019-03-21 19:53:12 +02:00
Yossi Gottlieb
e2626f69ec CommandFilter API: Add unregister option.
A filter handle is returned and can be used to unregister a filter.  In
the future it can also be used to further configure or manipulate the
filter.

Filters are now automatically unregistered when a module unloads.
2019-03-21 14:44:49 +02:00
John Sully
8ee38fa773 Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Former-commit-id: 31ff6cffee209ec03b8e7ed851145289c96de0f4
2019-03-19 01:26:10 -04:00
Yossi Gottlieb
a9a6a894e8 CommandFilter API: hellofilter and tests. 2019-03-18 23:07:28 +02:00
Yossi Gottlieb
9095e4dc9b Add command filter Module API tests. 2019-03-18 19:34:52 +02:00
antirez
dca7358279 HyperLogLog: speedup fuzz test. 2019-03-15 17:13:19 +01:00
antirez
4208666797 HyperLogLog: dense/sparse repr parsing fuzz test. 2019-03-15 13:52:29 +01:00
John Sully
46853f1357 Merge branch 'unstable' of https://github.com/antirez/redis into unstable
Lots of fixes and improvements from upstream.


Former-commit-id: 261cf24efc8bedec7ee76a8897b9a800a4d663e2
2019-03-13 18:08:22 -04:00
Salvatore Sanfilippo
3e648907ee
Merge pull request #5907 from spjwebster/xclaim-increment-delivery-count
Increment delivery counter on XCLAIM unless RETRYCOUNT specified
2019-03-13 11:55:46 +01:00
Steve Webster
dfcb227b50 Only increment delivery count if JUSTID option is omitted 2019-03-12 20:27:53 +00:00
Salvatore Sanfilippo
e5acc5ef4f
Merge pull request #2774 from rouzier/blocking-list-commands-support-milliseconds-floating
Added millisecond resolution for blpop command && friends
2019-03-12 18:10:28 +01:00
Steve Webster
f1e7df4b7c Increment delivery counter on XCLAIM unless RETRYCOUNT specified
The XCLAIM docs state the XCLAIM increments the delivery counter for
messages. This PR makes the code match the documentation - which seems
like the desired behaviour - whilst still allowing RETRYCOUNT to be
specified manually.

My understanding of the way streamPropagateXCLAIM() works is that this
change will safely propagate to replicas since retry count is pulled
directly from the streamNACK struct.

Fixes #5194
2019-03-08 17:09:11 +00:00
John Sully
3871725979 All tests pass single thread 2019-02-23 00:09:34 -05:00
John Sully
ebf0ae3e97 Merge branch 'unstable' of https://github.com/antirez/redis into Multithread 2019-02-21 18:17:12 -05:00
John Sully
6d8530d493 mitigate race condition in test 2019-02-15 16:55:19 -05:00
John Sully
d3fc46b3a8 complete rebranding with tests passing 2019-02-09 10:11:46 -05:00
antirez
f021da5e30 Acl: Test: check command rules synthesis. 2019-01-30 12:01:37 +01:00
antirez
7deb1e90d9 Acl: Test: check command rules synthesis. 2019-01-30 12:01:37 +01:00