dice
dice copied to clipboard
Flush store data to temp file in BGREWRITEAOF command and use fsync
Improve BGREWRITEAOF command (Issue is picked from TODO part in codebase)
- Make it safe from failure, an stable policy would be to write the new flushes to a temporary files and then rename them to the main process's AOF file
- Add fsync() and fdatasync() to persist to AOF for above cases.
Improvements
- If BGREWRITEAOF fails, no data gets lost as the old AOF will be untouched.