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
9fe02ce1
Unverified
Commit
9fe02ce1
authored
Feb 20, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Feb 20, 2020
Browse files
Merge pull request #6905 from guybe7/xgroup_destroy_unblock
XGROUP DESTROY should unblock XREADGROUP with -NOGROUP
parents
42c4d6ae
770cb0ba
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/t_stream.c
View file @
9fe02ce1
...
@@ -1850,6 +1850,8 @@ NULL
...
@@ -1850,6 +1850,8 @@ NULL
server
.
dirty
++
;
server
.
dirty
++
;
notifyKeyspaceEvent
(
NOTIFY_STREAM
,
"xgroup-destroy"
,
notifyKeyspaceEvent
(
NOTIFY_STREAM
,
"xgroup-destroy"
,
c
->
argv
[
2
],
c
->
db
->
id
);
c
->
argv
[
2
],
c
->
db
->
id
);
/* We want to unblock any XREADGROUP consumers with -NOGROUP. */
signalKeyAsReady
(
c
->
db
,
c
->
argv
[
2
]);
}
else
{
}
else
{
addReply
(
c
,
shared
.
czero
);
addReply
(
c
,
shared
.
czero
);
}
}
...
...
tests/unit/type/stream-cgroups.tcl
View file @
9fe02ce1
...
@@ -161,6 +161,15 @@ start_server {
...
@@ -161,6 +161,15 @@ start_server {
assert
{[
$rd
read
]
==
{}}
;
# before the fix, client didn't even block, but was served synchronously with
{
mystream
{}}
assert
{[
$rd
read
]
==
{}}
;
# before the fix, client didn't even block, but was served synchronously with
{
mystream
{}}
}
}
test
{
XGROUP DESTROY should unblock XREADGROUP with -NOGROUP
}
{
r del mystream
r XGROUP CREATE mystream mygroup $ MKSTREAM
set rd
[
redis_deferring_client
]
$rd XREADGROUP GROUP mygroup Alice BLOCK 100 STREAMS mystream
">"
r XGROUP DESTROY mystream mygroup
assert_error
"*NOGROUP*"
{
$rd
read
}
}
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