Consumer group lag property is not updated when unread messages are evicted from a stream #11646
Unanswered
carlos-gaspar
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Hello @carlos-gaspar - what a wonderful idea :) Off the top of my heap, I think this can be done fairly easily.... but I might be wrong (50:50), so I'd like @guybe7 to opine on this as well. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We have been expecting that the lag property (provided for stream consumer groups with command XINFO GROUPS) to be updated in case of messages that are removed from the stream before being read by the consumer group. It would be really worthy and simple to be used as metric to auto scale consumer instances.
In our use case, we use XTRIM to remove old messages from the stream, so we keep messages inside a time window (like last 2 hours).
In case of unavailability of consumers, we can reach a scenario where messages are removed from stream before being read. In this case we noticed that the lag property remains with its value unchanged.
We ran an example under extreme conditions (really short time window) and we can see that all messages were removed (and thus the stream length is 0), but, since many messages were removed before even being read by a consumer, the lag information remains greater than zero and it never resets.
`127.0.0.1:6379[10]> xinfo stream myStream
127.0.0.1:6379[10]> xinfo groups myStream
We were expecting that, in cases like that, the lag property to be reset.
Is the current behavior of the lag property the expected one?
In the affirmative case, is there anything different we should do?
Beta Was this translation helpful? Give feedback.
All reactions