Commit 511be70e authored by Oran Agra's avatar Oran Agra
Browse files

Fix crash unlinking a stream with groups rax and no groups (#8932)

When estimating the effort for unlink, we try to compute the effort of
the first group and extrapolate.
If there's a groups rax that's empty, there'a an assertion.

reproduce:
xadd s * a b
xgroup create s bla $
xgroup destroy s bla
unlink s

(cherry picked from commit 97108845)
parent 840f7f61
...@@ -109,7 +109,7 @@ size_t lazyfreeGetFreeEffort(robj *key, robj *obj) { ...@@ -109,7 +109,7 @@ size_t lazyfreeGetFreeEffort(robj *key, robj *obj) {
/* Every consumer group is an allocation and so are the entries in its /* Every consumer group is an allocation and so are the entries in its
* PEL. We use size of the first group's PEL as an estimate for all * PEL. We use size of the first group's PEL as an estimate for all
* others. */ * others. */
if (s->cgroups) { if (s->cgroups && raxSize(s->cgroups)) {
raxIterator ri; raxIterator ri;
streamCG *cg; streamCG *cg;
raxStart(&ri,s->cgroups); raxStart(&ri,s->cgroups);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment