Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongo - What does WriteConcern j option do when journaling is turned off?

The documentation is not clear on what happens when the Write Concern j Option is set to true and mongod is running without a journal. Does this indicate that the write operation will return after it has been acknowledged to have been committed to the database? OR can the write operation return before the write is committed to the database? Am I thinking about this incorrectly?

like image 837
SFun28 Avatar asked Apr 12 '16 14:04

SFun28


People also ask

How do I stop journaling in MongoDB?

To disable journaling for a standalone deployment, start mongod with the --nojournal command line option.

What is Writeconcern in MongoDB?

Write concern describes the level of acknowledgment requested from MongoDB for write operations to a standalone mongod or to replica sets or to sharded clusters. In sharded clusters, mongos instances will pass the write concern on to the shards.

Can I delete MongoDB Journal files?

The long answer: No, deleting the journal file isn't safe. The idea of journalling is this: A write comes in. Now, to make that write persistent (and the database durable), the write must somehow go to the disk.


1 Answers

You're thinking about it correctly. From the documentation:

Changed in version 2.6: Specifying a write concern that includes j: true to a mongod or mongos running with --nojournal option produces an error. Previous versions would ignore the j: true.

One can only assume that you will get some sort of error while trying to set it up as described.

like image 177
airudah Avatar answered Oct 14 '22 08:10

airudah