dragonfly icon indicating copy to clipboard operation
dragonfly copied to clipboard

BGSAVE and SAVE commands don't return OK immediately

Open safa-topal opened this issue 1 year ago • 3 comments

Describe the bug BGSAVE and SAVE commands doesn't return OK until background operation finishes. Redis BGSAVE works this way therefore a management code written for a Redis won't work well with Dragonfly at the moment.

To Reproduce Steps to reproduce the behavior:

  1. Run BGSAVE or SAVE
  2. Client waits to return OK until operation in the background finishes.

Expected behavior Client must return OK immediately for async nature of the relevant commands

Environment (please complete the following information): OS: Fedora 38 Kernel: 6.3.12-200.fc38.x86_64 Containerized?: toolbox Dragonfly Version: 1.14.4

safa-topal avatar Feb 22 '24 11:02 safa-topal

@safa-topal you got me here, I wanted to create an issue :stuck_out_tongue:

kostasrim avatar Feb 22 '24 11:02 kostasrim

It's indeed a behaviour difference. @safa-topal is it possible to workaround this issue on the client side by creating an async task that calls "BGSAVE"?

romange avatar Feb 22 '24 12:02 romange

@kostasrim much appreciated 🙏🏻

@romange yes, a workaround is possible for this (and not that urgent for my use-case because periodic save works fine and it encapsulates majority of the snapshotting logic)

safa-topal avatar Feb 22 '24 13:02 safa-topal

minor correction, save is blocking and should not return immediately

also we have to extra options. see the info on the referenced PR

kostasrim avatar Mar 08 '24 12:03 kostasrim