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

Empty Redis Stream Message Elasticache Redis 5.0.4 #6869

Open
StasKolodyuk opened this issue Feb 7, 2020 · 8 comments
Open

Empty Redis Stream Message Elasticache Redis 5.0.4 #6869

StasKolodyuk opened this issue Feb 7, 2020 · 8 comments

Comments

@StasKolodyuk
Copy link

Hi,

I've stumbled upon a situation when I have empty messages inside redis stream.
As far as I understand it's not possible to publish an empty message to a stream with XADD command.

Example:

XREADGROUP GROUP group a NOACK STREAMS advices 0
*1
*2
$7
advices
*14
*2
$15
1580490601492-0
*-1
*2
$15
1580492237190-0
*-1
*2
$15
1580496259890-0
*-1

Are you aware of cases that can result in such situation?
Thanks!

@itamarhaber
Copy link
Member

Hello @StasKolodyuk

This indeed should not be happening.

@StasKolodyuk
Copy link
Author

@itamarhaber is there smth I can provide you so you can start investigating? I have elasticache redis backup with those empty messages. Will it help?

@itamarhaber
Copy link
Member

I'm not quite sure how to investigate this yet so no need for backups just yet.

Is this reproducible somehow?

@madolson
Copy link
Contributor

@StasKolodyuk Hey, any chance you still have the context about this?

@StasKolodyuk
Copy link
Author

@madolson hey, what context do you need? This is still happening in our system in prod though rather rarely (1-2 times a week).

@asalabaev
Copy link

I actually like this feature. A nil result means that the event was added but then expired and I missed that. An extra piece of information that I could use to at least understand why it happens and how many events I miss.

@madolson
Copy link
Contributor

@asalabaev What do you mean by it was added and then expired?

@StasKolodyuk Perhaps some way to reproduce it so we can get to the bottom of the behavior :)

@asalabaev
Copy link

asalabaev commented Aug 12, 2021

@madolson sorry wrong word,
the case can be like the following:

  • XADD
  • XREADGROUP - but never acknowledge, e.g. processing failed and the consumer would like to reprocess it later. the item is in the pending list
  • XADD with MAXLEN (or probably XTRIM)
  • the stream was capped and the first event is gone
  • the event ID is still in the pending list! The consumer will get the nil body
    Here I know I missed that and the stream / consumers need reconfiguration. A useful information is not lost.

the original command now contains NOACK but it reads from the pending list hence it could happen in the original scenario as well

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

No branches or pull requests

4 participants