1127 Commits

Author SHA1 Message Date
antirez
3734ba96ba PSYNC2: meaningful offset test. 2020-03-25 15:43:34 +01:00
Oran Agra
fd1e1935a6 MULTI/EXEC during LUA script timeout are messed up
Redis refusing to run MULTI or EXEC during script timeout may cause partial
transactions to run.

1) if the client sends MULTI+commands+EXEC in pipeline without waiting for
response, but these arrive to the shards partially while there's a busy script,
and partially after it eventually finishes: we'll end up running only part of
the transaction (since multi was ignored, and exec would fail).

2) similar to the above if EXEC arrives during busy script, it'll be ignored and
the client state remains in a transaction.

the 3rd test which i added for a case where MULTI and EXEC are ok, and
only the body arrives during busy script was already handled correctly
since processCommand calls flagTransaction
2020-03-23 20:45:32 +02:00
antirez
fc92fa780b Fix BITFIELD_RO test. 2020-03-23 12:02:12 +01:00
Salvatore Sanfilippo
5f848d8cb3 Merge pull request #6951 from yangbodong22011/feature-bitfield-ro
Added BITFIELD_RO variants for read-only operations.
2020-03-23 11:23:21 +01:00
antirez
08af68436d Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-03-20 13:21:28 +01:00
antirez
bbbd16a90d Regression test for #7011. 2020-03-20 12:52:06 +01:00
WuYunlong
0c9916d008 Add 14-consistency-check.tcl to prove there is a data consistency issue. 2020-03-18 16:17:46 +08:00
bodong.ybd
53fd8f4d0d Fix bug of tcl test using external server 2020-03-11 21:01:27 +08:00
Oran Agra
d18e79f91d fix for flaky psync2 test
*** [err]: PSYNC2: total sum of full synchronizations is exactly 4 in tests/integration/psync2.tcl
Expected 5 == 4 (context: type eval line 6 cmd {assert {$sum == 4}} proc ::test)

issue was that sometime the test got an unexpected full sync since it
tried to switch to the replica before it was in sync with it's master.
2020-03-05 16:55:14 +02:00
bodong.ybd
e0cf09cace Added BITFIELD_RO variants for read-only operations. 2020-03-04 20:51:45 +08:00
Salvatore Sanfilippo
b6b48eb1b7 Merge pull request #6926 from oranagra/fork-test-fix
fix race in module api test for fork
2020-02-27 09:58:04 +01:00
Oran Agra
374f0f4a16 fix github actions failing latency test for active defrag - part 2
it seems that running two clients at a time is ok too, resuces action
time from 20 minutes to 10. we'll use this for now, and if one day it
won't be enough we'll have to run just the sensitive tests one by one
separately from the others.

this commit also fixes an issue with the defrag test that appears to be
very rare.
2020-02-27 08:34:53 +02:00
Oran Agra
7009978e25 fix github actions failing latency test for active defrag
seems that github actions are slow, using just one client to reduce
false positives.

also adding verbose, testing only on latest ubuntu, and building on
older one.

when doing that, i can reduce the test threshold back to something saner
2020-02-25 17:53:23 +02:00
Salvatore Sanfilippo
c72ab3dc46 Merge pull request #6920 from oranagra/defrag-test-latency-fix
Fix latency sensitivity of new defrag test
2020-02-24 11:53:32 +01:00
antirez
ab71e1020c Test engine: experimental change to avoid busy port problems. 2020-02-24 10:46:23 +01:00
Oran Agra
8e4b65874c fix race in module api test for fork
in some cases we were trying to kill the fork before it got created
2020-02-23 16:48:37 +02:00
Oran Agra
47cdf342fa Fix latency sensitivity of new defrag test
I saw that the new defag test for list was failing in CI recently, so i
reduce it's threshold from 12 to 60.

besides that, i add / improve the latency test for that other two defrag
tests (add a sensitive latency and digest / save checks)

and fix bad usage of debug populate (can't overrides existing keys).
this was the original intention, which creates higher fragmentation.
2020-02-23 13:05:52 +02:00
antirez
49b80848e7 Test engine: detect timeout when checking for Redis startup. 2020-02-21 18:55:56 +01:00
antirez
55bd09593d Test engine: better tracking of what workers are doing. 2020-02-21 17:08:45 +01:00
antirez
c67f606091 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2020-02-21 13:48:52 +01:00
antirez
fbcdb676ca Test is more complex now, increase default timeout. 2020-02-21 13:48:43 +01:00
Salvatore Sanfilippo
fd922f4c28 Merge pull request #6864 from guybe7/fix_memleak_in_test_ld_conv
Fix memory leak in test_ld_conv
2020-02-20 13:08:31 +01:00
Salvatore Sanfilippo
ed94dd9a63 Merge pull request #6903 from oranagra/defrag_lists
Defrag big lists in portions to avoid latency and freeze
2020-02-20 13:00:39 +01:00
Guy Benoish
e3b50b6432 XGROUP DESTROY should unblock XREADGROUP with -NOGROUP 2020-02-19 08:25:31 +05:30
Oran Agra
d3a0fc70c3 Defrag big lists in portions to avoid latency and freeze
When active defrag kicks in and finds a big list, it will create a bookmark to
a node so that it is able to resume iteration from that node later.

The quicklist manages that bookmark, and updates it in case that node is deleted.

This will increase memory usage only on lists of over 1000 (see
active-defrag-max-scan-fields) quicklist nodes (1000 ziplists, not 1000 items)
by 16 bytes.

In 32 bit build, this change reduces the maximum effective config of
list-compress-depth and list-max-ziplist-size (from 32767 to 8191)
2020-02-18 17:22:32 +02:00
antirez
0ae05a229a Tracking: first set of tests for the feature. 2020-02-14 14:29:00 +01:00
Guy Benoish
6c41cd1807 Fix memory leak in test_ld_conv 2020-02-06 18:36:21 +05:30
antirez
3d167847aa Merge branch 'acl-log' into unstable 2020-02-06 11:24:16 +01:00
antirez
f1518f63b1 ACL LOG: make max log entries configurable. 2020-02-04 13:19:40 +01:00
antirez
da054f14f0 ACL LOG: test for AUTH reason. 2020-02-04 12:58:48 +01:00
WuYunlong
c0c29adce9 Add tcl regression test in scripting.tcl to reproduce memory leak. 2020-02-04 16:34:11 +08:00
Guy Benoish
3fd717daee ld2string should fail if string contains \0 in the middle
This bug affected RM_StringToLongDouble and HINCRBYFLOAT.
I added tests for both cases.

Main changes:
1. Fixed string2ld to fail if string contains \0 in the middle
2. Use string2ld in getLongDoubleFromObject - No point of
   having duplicated code here

The two changes above broke RM_SaveLongDouble/RM_LoadLongDouble
because the long double string was saved with length+1 (An innocent
mistake, but it's actually a bug - The length passed to
RM_SaveLongDouble should not include the last \0).
2020-01-30 18:15:17 +05:30
antirez
8185f2b6ce ACL LOG: implement a few basic tests. 2020-01-30 11:14:13 +01:00
Salvatore Sanfilippo
d0bb1e572f Merge pull request #6699 from guybe7/module_blocked_on_key_timeout_memleak
Modules: Fix blocked-client-related memory leak
2020-01-29 12:06:14 +01:00
Salvatore Sanfilippo
7fc6cb4081 Merge pull request #6703 from guybe7/blocking_xread_empty_reply
Blocking XREAD[GROUP] should always reply with valid data (or timeout)
2020-01-09 17:32:14 +01:00
Guy Benoish
fe65141135 Modules: Fix blocked-client-related memory leak
If a blocked module client times-out (or disconnects, unblocked
by CLIENT command, etc.) we need to call moduleUnblockClient
in order to free memory allocated by the module sub-system
and blocked-client private data

Other changes:
Made blockedonkeys.tcl tests a bit more aggressive in order
to smoke-out potential memory leaks
2019-12-30 10:10:59 +05:30
Guy Benoish
13df904609 Blocking XREAD[GROUP] should always reply with valid data (or timeout)
This commit solves the following bug:
127.0.0.1:6379> XGROUP CREATE x grp $ MKSTREAM
OK
127.0.0.1:6379> XADD x 666 f v
"666-0"
127.0.0.1:6379> XREADGROUP GROUP grp Alice BLOCK 0 STREAMS x >
1) 1) "x"
   2) 1) 1) "666-0"
         2) 1) "f"
            2) "v"
127.0.0.1:6379> XADD x 667 f v
"667-0"
127.0.0.1:6379> XDEL x 667
(integer) 1
127.0.0.1:6379> XREADGROUP GROUP grp Alice BLOCK 0 STREAMS x >
1) 1) "x"
   2) (empty array)

The root cause is that we use s->last_id in streamCompareID
while we should use the last *valid* ID
2019-12-30 10:06:01 +05:30
Salvatore Sanfilippo
1eb8950f6a Merge pull request #6706 from guybe7/stream_id_edge_cases
Stream: Handle streamID-related edge cases
2019-12-29 14:53:06 +01:00
Oran Agra
f10051c5fd config.c adjust config limits and mutable
- make lua-replicate-commands mutable (it never was, but i don't see why)
- make tcp-backlog immutable (fix a recent refactory mistake)
- increase the max limit of a few configs to match what they were before
the recent refactory
2019-12-26 15:16:15 +02:00
Guy Benoish
6731e0dab5 Stream: Handle streamID-related edge cases
This commit solves several edge cases that are related to
exhausting the streamID limits: We should correctly calculate
the succeeding streamID instead of blindly incrementing 'seq'
This affects both XREAD and XADD.

Other (unrelated) changes:
Reply with a better error message when trying to add an entry
to a stream that has exhausted last_id
2019-12-26 15:31:37 +05:30
antirez
e7ddea016d Revert "Geo: output 10 chars of geohash, not 11."
This reverts commit bdca9e882d1619bde19cbad78549f3167ddc3d41.
2019-12-18 12:54:46 +01:00
zhaozhao.zz
5c56f82bc3 incrbyfloat: fix issue #5256 ttl lost after propagate 2019-12-18 15:44:51 +08:00
zhaozhao.zz
746c23419f add a new SET option KEEPTTL that doesn't remove expire time 2019-12-18 15:20:36 +08:00
Madelyn Olson
a48e2b721a Fixed some documentation 2019-12-17 07:49:21 +00:00
Madelyn Olson
f71437d391 Added some documentation and fixed a test 2019-12-17 07:15:04 +00:00
Madelyn Olson
05b7628687 Add module APIs for custom authentication 2019-12-17 06:59:59 +00:00
Yossi Gottlieb
937a32d84c Improve RM_ModuleTypeReplaceValue() API.
With the previous API, a NULL return value was ambiguous and could
represent either an old value of NULL or an error condition. The new API
returns a status code and allows the old value to be returned
by-reference.

This commit also includes test coverage based on
tests/modules/datatype.c which did not exist at the time of the original
commit.
2019-12-12 18:50:11 +02:00
Oran Agra
7450df6150 fix crash in module short read test 2019-12-02 19:17:35 +02:00
Salvatore Sanfilippo
d85f3e9c44 Merge pull request #6624 from oranagra/config_c_step_3
Additional config.c refractory and bugfixes
2019-12-02 08:59:36 +01:00
Oran Agra
8e19f9e048 revert an accidental test code change done as part of the tls project
it seems that commit 10ffeb03e4908b46c34f72d6b526ffa0834fd3f8 accidentially changed
gen_write_load to not use deferred client, which causes them to be slower and not
generate high load which they should, making some tests less effecitive
2019-12-01 16:10:09 +02:00