-
Notifications
You must be signed in to change notification settings - Fork 500
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
Dapr PubSub API: Trim Redis stream when TTL is set #3664
Comments
The problem users reported here was high memory usage for Redis topics. Currently, when a message can't be processed, or expires based on its TTL, Dapr copies it to a Dead Letter Queue (DLQ), if one is configured, but it doesn't delete it from the original topic. Redis streams work as an append-only-log and even though users have the possibility to delete messages from it, removal is not done automatically when a message is acknowledged. For reference, Kafka and AWS SQS behave the same, while RabbitMQ, ASB or Pulsar for example, do remove messagea after acknowledged. I see two possible options:
|
QQ on
|
It's actually the opposite, we move messages to the DLQ when they can't be processed (and thus acknowledged).
Yes, if the trim option would be enabled, the trimming will happen every time a message is added to the queue. |
I'm gonna move forward implementing option number two above: "We add a component-level config option specifically for Redis to continuously trim both topics and the DLQ based on number of entries or time (docs)" |
Okay perfect, as we discussed that the second option is more "redis-like" I think it makes sense to go this route. Plus it would give the option for when no consumers ever connect to the pubsub broker, it still wouldn't fill up. As an aside i do like the |
So we already supported |
Thanks @alicejgibbons and @elena-kolevska - Going the route of delete older than X looks great to me. I'm not sure how 'deleteonAck' would work since it could be many subscribers consuming from the same message. However, if we're thinking on setting max age per component this won't really work well for our use case. I was expecting per-message or at least per topic. I.e honor the metadata.ttlInSeconds data on the message. Thanks, |
@fsedano in this case could you use a separate Dapr component per topic? Then if there was only one topic per component, the |
I think we can also consider using something like the |
Describe the feature
Dapr should trim the pubsubs in redis streams honoring TTL.
When using redis streams, redis data is not purged once TTL expires. It's needed to write a custom cleaner, but this cleaner does not have visibility to the requested TTL for the message (and the cleaner would break once implementation details from dapr change).
Release Note
RELEASE NOTE: ADD Redis streams TTL deletes messages.
The text was updated successfully, but these errors were encountered: