Skip to content

Commit

Permalink
handle aof_flush_postponed_start as well
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-binbin committed Feb 8, 2024
1 parent 1e1df90 commit d6ab801
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/aof.c
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,9 @@ void flushAppendOnlyFile(int force) {
if (server.aof_flush_postponed_start == 0) {
/* No previous write postponing, remember that we are
* postponing the flush and return. */
server.aof_flush_postponed_start = server.unixtime;
server.aof_flush_postponed_start = server.mstime;
return;
} else if (server.unixtime - server.aof_flush_postponed_start < 2) {
} else if (server.mstime - server.aof_flush_postponed_start < 2000) {
/* We were already waiting for fsync to finish, but for less
* than two seconds this is still ok. Postpone again. */
return;
Expand Down
2 changes: 1 addition & 1 deletion src/server.h
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ struct redisServer {
sds aof_buf; /* AOF buffer, written before entering the event loop */
int aof_fd; /* File descriptor of currently selected AOF file */
int aof_selected_db; /* Currently selected DB in AOF */
time_t aof_flush_postponed_start; /* UNIX time of postponed AOF flush */
time_t aof_flush_postponed_start; /* mstime of postponed AOF flush */
time_t aof_last_fsync; /* mstime of last fsync() */
time_t aof_rewrite_time_last; /* Time used by last AOF rewrite run. */
time_t aof_rewrite_time_start; /* Current AOF rewrite start time. */
Expand Down

0 comments on commit d6ab801

Please sign in to comment.