Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unexpected behavior when turning appendonly on and off within a t…
…ransaction (#826) If we do `config set appendonly yes` and `config set appendonly no` in a multi, there are some unexpected behavior. When doing appendonly yes, we will schedule a AOFRW, and when we are doding appendonly no, we will call stopAppendOnly to stop it. In stopAppendOnly, the aof_fd is -1 since the aof is not start yet and the fsync and close will take the -1 and call it, so they will all fail with EBADF. And stopAppendOnly will emit a server log, the close(-1) should be no problem but it is still an undefined behavior. This PR also adds a log `Background append only file rewriting scheduled.` to bgrewriteaofCommand when it was scheduled. And adds a log in stopAppendOnly when a scheduled AOF is canceled, it will print `AOF was disabled but there is a scheduled AOF background, cancel it.` Signed-off-by: Binbin <[email protected]> Co-authored-by: Viktor Söderqvist <[email protected]>
- Loading branch information