为什么redis 3.2拒绝创建后台fsync?

时间:2017-03-08 15:53:02

标签: redis fsync

以下是aof.c中/* Perform the fsync if needed. */ if (server.aof_fsync == AOF_FSYNC_ALWAYS) { server.aof_last_fsync = server.unixtime; } else if ((server.aof_fsync == AOF_FSYNC_EVERYSEC && server.unixtime > server.aof_last_fsync)) { // Why create fsync job only while sync_in_progress is false? if (!sync_in_progress) aof_background_fsync(server.aof_fd); server.aof_last_fsync = server.unixtime; } 函数末尾的代码段,它在磁盘上写入aof缓冲区。

aof_background_fsync

Redis bio实现了fsync的后台作业列表。函数sync_in_progress将新的fsync作业附加到列表中。

为什么剂量redis仅在sync_in_progress为假时才在此文件上创建fsync作业?如果#columns { margin:.5%; } .pin { width:20%; vertical-align:top; display:inline-block; background-color:#fff; padding:1%; margin:1%; } .pin img { width: 100%; border-bottom: 1px solid #ccc; padding-bottom: 15px; margin-bottom: 5px; } .pin p { font: 12px/18px Arial, sans-serif; color: #333; margin: 0; min-height:100px; } 为真,则有几个fsync作业等待执行。为什么redis拒绝在这种情况下附加这个fsync作业?

(这是整个flushAppendOnlyFile function

0 个答案:

没有答案