200 Commits

Author SHA1 Message Date
121c51f4f3 Merge branch 'lcs' into unstable 2020-04-06 13:51:55 +02:00
af3c722fec LCS: more tests. 2020-04-06 13:51:49 +02:00
8dc28b6c75 LCS tests. 2020-04-06 13:45:37 +02:00
4665b3ebfb Fix no-negative-zero test 2020-04-02 18:41:29 +03:00
10b626b3d5 Merge pull request #6546 from guybe7/fix_neg_zero
Make sure Redis does not reply with negative zero
2020-04-02 16:26:57 +02:00
dfef407499 Merge pull request #7029 from valentinogeron/fix-xack
XACK should be executed in a "all or nothing" fashion.
2020-04-02 11:23:23 +02:00
6c8221580c RENAME can unblock XREADGROUP
Other changes:
Support stream in serverLogObjectDebugInfo
2020-03-31 17:41:10 +03:00
1547d72cf3 XACK should be executed in a "all or nothing" fashion.
First, we must parse the IDs, so that we abort ASAP.
The return value of this command cannot be an error if
the client successfully acknowledged some messages,
so it should be executed in a "all or nothing" fashion.
2020-03-26 15:40:23 +02:00
3b29556a0c AOFRW on an empty stream created with MKSTREAM loads badkly
the AOF will be loaded successfully, but the stream will be missing,
i.e inconsistencies with the original db.

this was because XADD with id of 0-0 would error.

add a test to reproduce.
2020-03-25 21:47:57 +02:00
770cb0ba97 XGROUP DESTROY should unblock XREADGROUP with -NOGROUP 2020-02-19 08:25:31 +05:30
2deb55512f 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
bb93686754 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
a351e74fe9 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
1f75ce30df 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
936e01e5bb Fix stream test after addition of 0-0 ID test. 2019-11-19 11:49:05 +01:00
4a12047c61 XADD with ID 0-0 stores an empty key
Calling XADD with 0-0 or 0 would result in creating an
empty key and storing it in the database.
Even worse, because XADD will reply with error the action
will not be replicated, creating a master-replica
inconsistency
2019-11-13 16:47:30 +05:30
8beec4f0e7 Make sure Redis does not reply with negative zero 2019-11-05 19:23:37 +05:30
b12d2f65d6 fix unreported overflow in autogerenared stream IDs 2019-11-04 16:36:06 +01:00
dd29d44136 Test: fix implementation-dependent test after code change. 2019-10-10 15:22:42 +02:00
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
dfcb227b50 Only increment delivery count if JUSTID option is omitted 2019-03-12 20:27:53 +00:00
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
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
46a51cdcdc Merge pull request #5549 from oranagra/fix_test_races
fix small test suite race conditions
2018-11-28 18:17:05 +01:00
fc022031d3 Merge branch 'unstable' of github.com:/antirez/redis into unstable 2018-11-28 17:12:32 +01:00
c99f1206b7 Add unit test for stream XCLAIM command. 2018-11-28 17:12:03 +01:00
6a6471aad5 Merge pull request #4737 from guybe7/zlexcount_fix
Don't call sdscmp() with shared.maxstring or shared.minstring
2018-11-28 16:53:32 +01:00
30a455f14a Test: regression test for #5570. 2018-11-19 17:19:33 +01:00
db8d7d3dc4 Test: regression test for #5577. 2018-11-19 16:50:54 +01:00
d0850369c4 fix small test suite race conditions 2018-11-12 10:26:10 +02:00
56871aeb60 Tests for XGROUP CREATE MKSTREAM. 2018-10-17 12:11:10 +02:00
c2e4c64db4 Streams: Tests modified XSTREAM -> XSETID 2018-10-16 23:56:26 +08:00
b4f8268371 Tests modified to use XADD MAXLEN 0 + XSETID.
See #5426.
2018-10-16 17:28:56 +02:00
af09df08d7 Merge pull request #5426 from soloestoy/feature-xstream
Bugfix data inconsistency after aof rewrite, and add XSTREAM command.
2018-10-16 13:10:36 +02:00
fbfd61b471 Test: cgroup propagation test also for NOACK variant.
Related to #5433.
2018-10-10 17:37:41 +02:00
cfad5e4587 Test: consumer group last ID slave propagation test.
This is a regression for #5433.
2018-10-10 17:32:17 +02:00
3094eb3626 Streams: add tests for aof rewrite 2018-10-09 15:45:58 +08:00
5f3adbee33 Streams: add tests for XSTREAM command 2018-10-09 15:21:08 +08:00
e5f1de1448 Merge pull request #5141 from soloestoy/fix-xtrim-inconsistency
Fix XTRIM and XADD with MAXLEN inconsistency
2018-10-08 12:00:00 +02:00
d506334b67 Test: new sorted set skiplist order consistency.
This should be able to find new bugs and regressions about the new
sorted set update function when ZADD is used to update an element
already existing.

The test is able to find the bug fixed at 2f282aee immediately.
2018-08-02 14:15:53 +02:00
60acac4cd0 Streams: add test cases for XADD/XTRIM maxlen 2018-08-01 10:34:29 +08:00
2352a51992 Test: XDEL fuzz testing. Remove and check stage. 2018-07-13 17:58:17 +02:00
d6efd5fc1d Test: XDEL fuzz testing, stream creation. 2018-07-13 17:47:26 +02:00
a93f8f0998 Test: XDEL basic test. 2018-07-13 17:40:48 +02:00
8d6b7861a7 Add regression test for #5111. 2018-07-12 13:35:17 +02:00
93238575f7 Fix typo 2018-07-03 18:19:46 +02:00
6bf65138de Regression test for issue #5006. 2018-06-12 13:13:35 +02:00
0a698e499a ZPOP: invert score-ele to match ZRANGE WITHSCORES order. 2018-06-05 17:06:25 +02:00
2bd36616ba Streams: fix test ID format. 2018-05-25 16:57:08 +02:00
e87c1f1e6c ZPOP: fix the tests according to new non-blocking "count" argument. 2018-05-11 18:07:10 +02:00