From 3780c517c5ba15d27c5eebed5fb65901adeaa2c5 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 5c1b7d4c4..54d6b0d1f 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) {