This is a potential issue due to an omission in the design.

It was raised during a CR w/ @guybe7.

Quick context: the lag heuristic depends on the stream's and the cg's counters (entries_added & entries_read). Change's to the group's last_id should, in theory, invalidate its entries_read to keep correctness.

A problem may arise when issuing the XCLAIM with the LASTID argument. This invocation is there, by the looks of it, for replication purposes and is used internally only (I do hope). For correctness, the CG's entries_read needs to be invalidation around this LoC

Comment From: oranagra

@itamarhaber is that a bug you intend to fix or ask someone else to fix?

Comment From: hwware

@itamarhaber could you please tell me more infomation about it, so I could help handle it? Thanks

Comment From: itamarhaber

Sure - updated the top comment.

I'm not sure there's a serious bug there, but a fix (+test) would reduce the probability to zero :)