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

Set and hash field expirations are not persisted after restart #2052

Closed
UkuLoskit opened this issue Oct 21, 2023 · 2 comments · Fixed by #2223
Closed

Set and hash field expirations are not persisted after restart #2052

UkuLoskit opened this issue Oct 21, 2023 · 2 comments · Fixed by #2223
Assignees
Labels
bug Something isn't working

Comments

@UkuLoskit
Copy link
Contributor

UkuLoskit commented Oct 21, 2023

Describe the bug
When using Dragonfly-specific functionality that enables setting expiration for fields, i.e HSETEX and SADDEX, the expiration is not persisted after restarting Dragonfly.

To Reproduce

HSETEX myhash 30 foo bar

restart Dragonfly
sleep 30;
HGET myhash foo
bar  < --- field foo still exists

Expected behavior

HSETEX myhash 30 foo bar

restart Dragonfly
sleep 30;
HGET myhash foo
(nil)

Environment (please complete the following information):

  • Dragonfly Version: Dragonfly HEAD
@UkuLoskit UkuLoskit added the bug Something isn't working label Oct 21, 2023
@chakaz
Copy link
Collaborator

chakaz commented Nov 1, 2023

This bug also affects replication in (at least?) 2 ways:

  1. Replica which connects after a key with element expiry was set will never remove the expired element (it will simply not know about the expiration)
  2. Replica which connects before a key was set (i.e. that it gets the original command HSETEX command) will remove the items on its own, instead of waiting for expiration removal event coming from the master

@chakaz
Copy link
Collaborator

chakaz commented Nov 1, 2023

And fixing this is not trivial as it:

  1. Will break compatibility with Redis RDB format
  2. Will break compatibility with old Dragonfly replicas
  3. Will break compatibility with old Dragonfly servers trying to load new RDB files

All of these can and should be resolved, but I'm trying to say that it's not an easy solution and we need to be careful here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants