Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XREADGROUP skips messages if body is nil #1622

Closed
asalabaev opened this issue Feb 13, 2021 · 1 comment
Closed

XREADGROUP skips messages if body is nil #1622

asalabaev opened this issue Feb 13, 2021 · 1 comment
Labels
type: bug A general bug
Milestone

Comments

@asalabaev
Copy link

Bug Report

Current Behavior

I have a capped stream and a consumer has read messages and did no acknowledge. Then those messages got trimmed, but they remain in PEL of the consumer. Lettuce seems to return items skipping like if body nil fooled it

I have 10 pending messages via redis-cli:
> xreadgroup GROUP clickhouse5 LogToCH-1 count 12500 streams LOG 0-0
1) 1) "LOG"
   2)  1) 1) "1613148827078-6"
          2) (nil)
       2) 1) "1613149395197-12"
          2) (nil)
       3) 1) "1613151931878-5"
          2) (nil)
       4) 1) "1613152648864-7"
          2) (nil)
       5) 1) "1613157152132-67"
          2) (nil)
       6) 1) "1613159691817-0"
          2) (nil)
       7) 1) "1613161933879-11"
          2) (nil)
       8) 1) "1613162164941-3"
          2) (nil)
       9) 1) "1613164598204-0"
          2) (nil)
      10) 1) "1613169116881-8"
          2) (nil)

then I run the same reading command in lettuce

15:21:40.990 [thread-1] DEBUG RedisStreamClientRead - LOG:clickhouse5:LogToCH-1> (1613218900989) reading Pending after 0-0
15:21:40.990 [thread-1] TRACE RedisStreamClientRead - LOG:clickhouse5:LogToCH-1: begin reading from stream 25000 items
15:21:41.160 [thread-1] TRACE RedisStreamClientRead - LOG:clickhouse5:LogToCH-1 xreadGroup returned 5 items timetaken 169 ms
15:21:41.161 [thread-1] DEBUG RedisStreamClientRead - LOG:clickhouse5:LogToCH-1> (1613218900989) received 5: 1613148827078-6 - 1613164598204-0

In the last line the log reports the first and the last read message ID

after the messages are processed and acknowledged I check the PEL in redis-cli again

> xreadgroup GROUP clickhouse5 LogToCH-1 count 12500 streams LOG 0-0
1) 1) "LOG"
   2) 1) 1) "1613149395197-12"
         2) (nil)
      2) 1) "1613152648864-7"
         2) (nil)
      3) 1) "1613159691817-0"
         2) (nil)
      4) 1) "1613162164941-3"
         2) (nil)
      5) 1) "1613169116881-8"
         2) (nil)

You can see that every even message remained in the PEL and every odd is gone.

Expected behavior/code

I would assume that the xreadgroup should return all messages like the redis-cli does. I also do not know any good way of bringing down the PEL to 0 other than doing it log2 times

Environment

  • Lettuce version(s): 5.3.1.RELEASE
  • Redis version: 5.0.5
@mp911de
Copy link
Collaborator

mp911de commented Mar 4, 2021

That issue happens only when using RESP2. That's fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants