When does MongoDB (with logging enabled) call fsync ()?

Starting with version 1.7.5 MongoDB supports the so-called "Single Server Durability". According to the documentation , this is achieved through the use of a write-write log, which can be answered in case of a server failure.

I find it difficult to understand the “Commit Confirmation” section of the Journaling page in the MongoDB documentation:

You can wait for confirmation to commit the group using the getLastError command. When launched with --dur the fsync:true parameter returns after the data is physically written to the log (and not actually fsync'ing) . Note that the group commit interval ( see above ) is significant: you may prefer to call getLastError without fsync or using the w: parameter instead with replication. In versions after 1.8.0, the delay for confirming the commit will be shorter.

Does this mean that journaling relies on the operating system to flush changes to disk? Or does this mean that the write-ahead-fsync'ed log is every 100 ms regardless of whether the user requests fsync'ed or not?

+4
source share
1 answer

write-ahead-fsync'ed log every 100 ms.

+1
source

Source: https://habr.com/ru/post/1338066/


All Articles