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

HEXPIRE: update expiration time without updating the hash's value #3027

Open
Le0Developer opened this issue May 8, 2024 · 0 comments
Open
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Le0Developer
Copy link

Is your feature request related to a problem? Please describe.
For ratelimit tracking, we currently use hashes instead of full keys for more efficient bulk retrieval (instead of using hash slots when clustering).

Currently, we need to do HINCRBY key field 1 and if the value is 1, we do a followup HSETEX key date field 1.
This means increments that happen between the HINCRBY and HSETEX command may be lost because the HSETEX command will always reset it to 1.

The EXPIRE command exists to solve this exact problem, so having HEXPIRE would prevent race conditions nicely here too.

Describe the solution you'd like
HEXPIRE key field duration

Related
#3026 for HTTL

@romange romange added enhancement New feature or request help wanted Extra attention is needed labels May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants