Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
a20c206d
Unverified
Commit
a20c206d
authored
Mar 31, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Mar 31, 2020
Browse files
Merge pull request #7048 from guybe7/rename_unblock_stream
RENAME can unblock XREADGROUP
parents
1b4bc609
6c822158
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
a20c206d
...
@@ -182,7 +182,8 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
...
@@ -182,7 +182,8 @@ void dbAdd(redisDb *db, robj *key, robj *val) {
serverAssertWithInfo
(
NULL
,
key
,
retval
==
DICT_OK
);
serverAssertWithInfo
(
NULL
,
key
,
retval
==
DICT_OK
);
if
(
val
->
type
==
OBJ_LIST
||
if
(
val
->
type
==
OBJ_LIST
||
val
->
type
==
OBJ_ZSET
)
val
->
type
==
OBJ_ZSET
||
val
->
type
==
OBJ_STREAM
)
signalKeyAsReady
(
db
,
key
);
signalKeyAsReady
(
db
,
key
);
if
(
server
.
cluster_enabled
)
slotToKeyAdd
(
key
);
if
(
server
.
cluster_enabled
)
slotToKeyAdd
(
key
);
}
}
...
...
src/debug.c
View file @
a20c206d
...
@@ -817,6 +817,8 @@ void serverLogObjectDebugInfo(const robj *o) {
...
@@ -817,6 +817,8 @@ void serverLogObjectDebugInfo(const robj *o) {
serverLog
(
LL_WARNING
,
"Sorted set size: %d"
,
(
int
)
zsetLength
(
o
));
serverLog
(
LL_WARNING
,
"Sorted set size: %d"
,
(
int
)
zsetLength
(
o
));
if
(
o
->
encoding
==
OBJ_ENCODING_SKIPLIST
)
if
(
o
->
encoding
==
OBJ_ENCODING_SKIPLIST
)
serverLog
(
LL_WARNING
,
"Skiplist level: %d"
,
(
int
)
((
const
zset
*
)
o
->
ptr
)
->
zsl
->
level
);
serverLog
(
LL_WARNING
,
"Skiplist level: %d"
,
(
int
)
((
const
zset
*
)
o
->
ptr
)
->
zsl
->
level
);
}
else
if
(
o
->
type
==
OBJ_STREAM
)
{
serverLog
(
LL_WARNING
,
"Stream size: %d"
,
(
int
)
streamLength
(
o
));
}
}
}
}
...
...
tests/unit/type/stream-cgroups.tcl
View file @
a20c206d
...
@@ -170,6 +170,27 @@ start_server {
...
@@ -170,6 +170,27 @@ start_server {
assert_error
"*NOGROUP*"
{
$rd
read
}
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
}
{
test
{
XCLAIM can claim PEL items from another consumer
}
{
# Add 3 items into the stream, and create a consumer group
# Add 3 items into the stream, and create a consumer group
r del mystream
r del mystream
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment