dragonfly
dragonfly copied to clipboard
BGSAVE and SAVE commands don't return OK immediately
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:
- Run BGSAVE or SAVE
- 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 you got me here, I wanted to create an issue :stuck_out_tongue:
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"?
@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)
minor correction, save
is blocking and should not return immediately
also we have to extra options. see the info on the referenced PR