Commit b6260a02 authored by antirez's avatar antirez
Browse files

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.
parent a7c180e5
...@@ -918,10 +918,10 @@ size_t streamReplyWithRange(client *c, stream *s, streamID *start, streamID *end ...@@ -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) {
......
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