-
Type: Task
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
Labels:
-
Environment:N/A
*Location*: http://docs.mongodb.org/manual/core/write-concern/
*User-Agent*: Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.16
*Referrer*: http://stackoverflow.com/questions/18488209/does-mongodb-journaling-guarantee-durability/18489344
*Screen Resolution*: 1920 x 1080
*repo*: docs
*source*: core/write-concern
N/A *Location*: http://docs.mongodb.org/manual/core/write-concern/ *User-Agent*: Opera/9.80 (Windows NT 6.1; WOW64) Presto/2.12.388 Version/12.16 *Referrer*: http://stackoverflow.com/questions/18488209/does-mongodb-journaling-guarantee-durability/18489344 *Screen Resolution*: 1920 x 1080 *repo*: docs *source*: core/write-concern
The description for the section "Journaled" is misleading, at least if I understand the source code correctly. The documentation says:
"However, there is a window between journal commits when the write operation is not fully durable". That probably refers to a mongod running with journaling on that accepts a write that does NOT use the j:true write concern. In that case, there's a chance of the write getting lost since the last journal commit.
If j:true is specified, however, the write operation (or, more precisely, the getLastError command) will block until the server's durability thread has flushed all pending changes to disk, so the client can be sure that the data has been written.