From b6260a027026d1a5a6fa4fa0d8527de86066de8e Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 12 Jul 2018 13:19:39 +0200 Subject: [PATCH] Streams: when re-delivering because of SETID, reset deliveries counter. We don't want to increment the deliveries here, because the sysadmin reset the consumer group so the desire is likely to restart processing, and having the PEL polluted with old information is not useful but probably confusing. Related to #5111. --- src/t_stream.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/t_stream.c b/src/t_stream.c index 5c1b7d4c..54d6b0d1 100644 --- a/src/t_stream.c +++ b/src/t_stream.c @@ -918,10 +918,10 @@ size_t streamReplyWithRange(client *c, stream *s, streamID *start, streamID *end nack = raxFind(group->pel,buf,sizeof(buf)); serverAssert(nack != raxNotFound); raxRemove(nack->consumer->pel,buf,sizeof(buf),NULL); - /* Update the consumer and idle time. */ + /* Update the consumer and NACK metadata. */ nack->consumer = consumer; nack->delivery_time = mstime(); - nack->delivery_count++; + nack->delivery_count = 1; /* Add the entry in the new consumer local PEL. */ raxInsert(consumer->pel,buf,sizeof(buf),nack,NULL); } else if (group_inserted == 1 && consumer_inserted == 0) {