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.
This commit is contained in:
antirez 2018-07-12 13:19:39 +02:00
parent a7c180e559
commit b6260a0270

View File

@ -918,10 +918,10 @@ size_t streamReplyWithRange(client *c, stream *s, streamID *start, streamID *end
nack = raxFind(group->pel,buf,sizeof(buf)); nack = raxFind(group->pel,buf,sizeof(buf));
serverAssert(nack != raxNotFound); serverAssert(nack != raxNotFound);
raxRemove(nack->consumer->pel,buf,sizeof(buf),NULL); raxRemove(nack->consumer->pel,buf,sizeof(buf),NULL);
/* Update the consumer and idle time. */ /* Update the consumer and NACK metadata. */
nack->consumer = consumer; nack->consumer = consumer;
nack->delivery_time = mstime(); nack->delivery_time = mstime();
nack->delivery_count++; nack->delivery_count = 1;
/* Add the entry in the new consumer local PEL. */ /* Add the entry in the new consumer local PEL. */
raxInsert(consumer->pel,buf,sizeof(buf),nack,NULL); raxInsert(consumer->pel,buf,sizeof(buf),nack,NULL);
} else if (group_inserted == 1 && consumer_inserted == 0) { } else if (group_inserted == 1 && consumer_inserted == 0) {