RENAME can unblock XREADGROUP

Other changes:
Support stream in serverLogObjectDebugInfo
This commit is contained in:
Guy Benoish
2020-03-31 17:37:05 +03:00
committed by antirez
parent 97b80b57e9
commit 805c8c94a9
3 changed files with 25 additions and 1 deletions

View File

@@ -170,6 +170,27 @@ start_server {
assert_error "*NOGROUP*" {$rd read}
}
test {RENAME can unblock XREADGROUP with data} {
r del mystream
r XGROUP CREATE mystream mygroup $ MKSTREAM
set rd [redis_deferring_client]
$rd XREADGROUP GROUP mygroup Alice BLOCK 0 STREAMS mystream ">"
r XGROUP CREATE mystream2 mygroup $ MKSTREAM
r XADD mystream2 100 f1 v1
r RENAME mystream2 mystream
assert_equal "{mystream {{100-0 {f1 v1}}}}" [$rd read] ;# mystream2 had mygroup before RENAME
}
test {RENAME can unblock XREADGROUP with -NOGROUP} {
r del mystream
r XGROUP CREATE mystream mygroup $ MKSTREAM
set rd [redis_deferring_client]
$rd XREADGROUP GROUP mygroup Alice BLOCK 0 STREAMS mystream ">"
r XADD mystream2 100 f1 v1
r RENAME mystream2 mystream
assert_error "*NOGROUP*" {$rd read} ;# mystream2 didn't have mygroup before RENAME
}
test {XCLAIM can claim PEL items from another consumer} {
# Add 3 items into the stream, and create a consumer group
r del mystream