214 Commits

Author SHA1 Message Date
John Sully
3e8ac111b5 Prevent test crash due to unimplemented save for nested hash
Former-commit-id: 7e0077f293c5f91f240ab401e5f167e487afbfe0
2020-12-11 00:23:44 +00:00
John Sully
2fdac516a6 Add missing file
Former-commit-id: 97fd73692363e05b80e0c0e84b7b2b8fe7f760b8
2020-11-11 03:29:38 +00:00
John Sully
14daf6f909 Merge tag '6.0.8' into unstable
Former-commit-id: 4c7e4b91a6bb2034636856b608b8c386d07f5541
2020-09-30 19:47:55 +00:00
Valentino Geron
34124fff88 Fix LPOS command when RANK is greater than matches
When calling to LPOS command when RANK is higher than matches,
the return value is non valid response. For example:
```
LPUSH l a
:1
LPOS l b RANK 5 COUNT 10
*-4
```
It may break client-side parser.

Now, we count how many replies were replied in the array.
```
LPUSH l a
:1
LPOS l b RANK 5 COUNT 10
*0
```

(cherry picked from commit 7a555da64f56a4fb2f300d84a35778bee8f471ca)
2020-09-01 09:27:58 +03:00
WuYunlong
8b20802a09 Fix command help for unexpected options (#7476)
(cherry picked from commit e5166eccee3396a24dfd3a79d3211943e5a3d25e)
2020-07-20 21:08:26 +03:00
Oran Agra
cf116e08cc skip a test that uses +inf on valgrind (#7440)
On some platforms strtold("+inf") with valgrind returns a non-inf result

[err]: INCRBYFLOAT does not allow NaN or Infinity in tests/unit/type/incr.tcl
Expected 'ERR*would produce*' to equal or match '1189731495357231765085759.....'

(cherry picked from commit 6b53c630d92c8fbeb9bea0c406c9454fb68b8467)
2020-07-20 21:08:26 +03:00
antirez
ecb2743e8a LPOS: option FIRST renamed RANK.
(cherry picked from commit 5b16c2f1744abf2640549e36fa2744417d427b7c)
2020-07-20 21:08:26 +03:00
antirez
3dc6657ea8 LPOS: tests + crash fix. 2020-06-12 12:08:06 +02:00
John Sully
97908941bf Stream tests rely on deferring clients, mitigate races caused by them
Former-commit-id: 2caf8e4c8095215b189942b7eaec3bf5023f7fcf
2020-06-07 13:59:41 -04:00
John Sully
de0540d34b Fix client race in test (test only issue)
Former-commit-id: f25aebf2698509a132ebf599374b245efb51e365
2020-05-31 21:39:50 -04:00
John Sully
193d7c76cb Fix bad merge in CI.yml
Former-commit-id: 6311d709c39b3bacaeab77b18033010f1b548f81
2020-05-21 22:09:06 -04:00
John Sully
8377df8330 Merge commit '87924d673138531cbaf606015ea7b6a9e3ae2465' into unstable
Former-commit-id: 3e03f308b564cd94f4a6407c80792d080e0f83c5
2020-05-21 17:55:09 -04:00
John Sully
4246199553 Merge commit '7cb94fd6cc9e1ad106964171023457ae3ff0a40b' into unstable
Former-commit-id: 7676f5b15f24a044257250b8891d23b14642da48
2020-05-21 17:36:53 -04:00
John Sully
b47d7715a4 Merge commit '71134e357ffd6ced7c40c145205dbbac173ee181' into unstable
Former-commit-id: d5b057534a3dbf50f94465332107da2490811946
2020-05-21 17:32:53 -04:00
John Sully
da7765a84e hrename tests
Former-commit-id: f77c227b2d34b7ec74c1fc993e03f063dcbfa090
2020-05-10 17:14:44 -04:00
Guy Benoish
dc3d865edc Extend XINFO STREAM output
Introducing XINFO STREAM <key> FULL
2020-04-30 13:02:58 +02:00
Guy Benoish
aafc91fcc9 Add the stream tag to XSETID tests 2020-04-27 15:52:49 +02:00
antirez
262da0ba78 LCS -> STRALGO LCS.
STRALGO should be a container for mostly read-only string
algorithms in Redis. The algorithms should have two main
characteristics:

1. They should be non trivial to compute, and often not part of
programming language standard libraries.
2. They should be fast enough that it is a good idea to have optimized C
implementations.

Next thing I would love to see? A small strings compression algorithm.
2020-04-24 16:49:27 +02:00
antirez
87924d6731 LCS: more tests. 2020-04-07 16:52:57 +02:00
antirez
106501fab0 LCS tests. 2020-04-07 16:52:57 +02:00
Guy Benoish
7cb94fd6cc Fix no-negative-zero test 2020-04-07 16:52:04 +02:00
Valentino Geron
1f6160ccb2 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-04-07 16:52:04 +02:00
Guy Benoish
3a063f58c8 Make sure Redis does not reply with negative zero 2020-04-07 16:52:04 +02:00
Guy Benoish
07acd86c7e RENAME can unblock XREADGROUP
Other changes:
Support stream in serverLogObjectDebugInfo
2020-03-31 16:57:20 +02:00
Oran Agra
454e12cb89 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-31 16:57:20 +02:00
Guy Benoish
d1be7aaa18 XGROUP DESTROY should unblock XREADGROUP with -NOGROUP 2020-02-27 18:00:47 +01:00
Guy Benoish
2ad427f862 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-02-04 10:23:48 +01:00
Guy Benoish
3913ffd5bc 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
2020-01-10 13:16:14 +01:00
Guy Benoish
444dd1075c 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-29 15:46:31 +01:00
antirez
fa60228c08 Fix stream test after addition of 0-0 ID test. 2019-11-19 11:49:05 +01:00
Guy Benoish
181ae55753 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
Loris Cro
61d46950dc fix unreported overflow in autogerenared stream IDs 2019-11-04 16:36:06 +01:00
antirez
0ec3cbdb8d Test: fix implementation-dependent test after code change. 2019-10-10 15:22:42 +02:00
Salvatore Sanfilippo
cb44f7ece0 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
c652f706cb Only increment delivery count if JUSTID option is omitted 2019-03-12 20:27:53 +00:00
Salvatore Sanfilippo
685d10894b 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
8fd63c220a 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
Salvatore Sanfilippo
0423081513 Merge pull request #5549 from oranagra/fix_test_races
fix small test suite race conditions
2018-11-28 18:17:05 +01:00
antirez
5f4be1f85c Merge branch 'unstable' of github.com:/antirez/redis into unstable 2018-11-28 17:12:32 +01:00
Qu Chen
36af9ebbd4 Add unit test for stream XCLAIM command. 2018-11-28 17:12:03 +01:00
Salvatore Sanfilippo
390e02f2c9 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
antirez
068e49c65a Test: regression test for #5570. 2018-11-19 17:19:33 +01:00
antirez
562588cf29 Test: regression test for #5577. 2018-11-19 16:50:54 +01:00
Oran Agra
05d6b8b9ae fix small test suite race conditions 2018-11-12 10:26:10 +02:00
antirez
de887c7e1d Tests for XGROUP CREATE MKSTREAM. 2018-10-17 12:11:10 +02:00
zhaozhao.zz
340e1b8c96 Streams: Tests modified XSTREAM -> XSETID 2018-10-16 23:56:26 +08:00
antirez
f501a8367c Tests modified to use XADD MAXLEN 0 + XSETID.
See #5426.
2018-10-16 17:28:56 +02:00
Salvatore Sanfilippo
ff1b36c825 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
antirez
b43c423a81 Test: cgroup propagation test also for NOACK variant.
Related to #5433.
2018-10-10 17:37:41 +02:00
antirez
d2fa12b96a Test: consumer group last ID slave propagation test.
This is a regression for #5433.
2018-10-10 17:32:17 +02:00