summaryrefslogtreecommitdiff
path: root/src/lazyfree.c
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2021-05-10 17:08:43 +0300
committerGitHub <noreply@github.com>2021-05-10 17:08:43 +0300
commit97108845e2ae7661e5091c817cb03459ec81ea8c (patch)
tree6de2ec1322ffdb89d618da4f1e30202d7ade0b0c /src/lazyfree.c
parentfb66c1b58cbf84ad5372a2c793399d9301564da5 (diff)
downloadredis-97108845e2ae7661e5091c817cb03459ec81ea8c.tar.gz
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
Diffstat (limited to 'src/lazyfree.c')
-rw-r--r--src/lazyfree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lazyfree.c b/src/lazyfree.c
index a2cf2c3ed..180a4349b 100644
--- a/src/lazyfree.c
+++ b/src/lazyfree.c
@@ -109,7 +109,7 @@ size_t lazyfreeGetFreeEffort(robj *key, robj *obj) {
/* 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
* others. */
- if (s->cgroups) {
+ if (s->cgroups && raxSize(s->cgroups)) {
raxIterator ri;
streamCG *cg;
raxStart(&ri,s->cgroups);