Mongo 3.0 - RocksDB

83 views
Skip to first unread message

Aishwarya Ganesan

unread,
Apr 26, 2016, 8:35:00 AM4/26/16
to mongodb-dev
Hi,

I would like to use mongoDB 3.0 with rocksdb as storage engine.  If my writes are with j: true, does this guarantee that writes go to the journal before it is acknowledged?
Is there a rocksdb config that I should change or j:true in my query takes care of it?

Thanks,
Aishwarya

Igor Canadi

unread,
Apr 26, 2016, 4:46:14 PM4/26/16
to mongodb-dev
Hi Aishwarya,

MongoDB with RocksDB sends all writes to the journal if you enabled the journal. This behavior does not depend on the value of `j` write concern option.

Best,
Igor

Aishwarya Ganesan

unread,
Apr 26, 2016, 10:20:21 PM4/26/16
to mongodb-dev
Thanks for the reply.  I wasn't clear in my question. I notice that the journal is getting created in my mongodb data directory and also that writes are going to the journal. 
I want to make sure that the journal is fsynced before the write is acknowledged. Is j: true sufficient to achieve this?

Igor Canadi

unread,
Apr 27, 2016, 2:03:01 PM4/27/16
to mongo...@googlegroups.com
Ah, I see. I'm not sure if you actually fsync the write to the journal with `j: true` option. Rocks behavior in this point is equivalent to WiredTiger's, since we expose the same function in the storage engine API, that asks us to fsync the write to journal:

But I'm not sure what's the WT's behavior like. In the documentation it says "j:true will acknowledge the write once it gets written to the journal", but it doesn't specify whether the commit will be fsync-ed or not.

Here's how you could verify it: strace the mongod process and send it a write with j: true. If you see 'fsync' happening, than waitUntilDurable() has been called and the write is fsynced.

Hope this answers your question.

Best,
Igor

--
You received this message because you are subscribed to a topic in the Google Groups "mongodb-dev" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mongodb-dev/TibNF4CC-sI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mongodb-dev...@googlegroups.com.
To post to this group, send email to mongo...@googlegroups.com.
Visit this group at https://groups.google.com/group/mongodb-dev.
For more options, visit https://groups.google.com/d/optout.

Asya Kamsky

unread,
Apr 27, 2016, 4:56:09 PM4/27/16
to mongo...@googlegroups.com
The write will be acknowledged when the journal is synced to disk.

Asya
> You received this message because you are subscribed to the Google Groups
> "mongodb-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-dev...@googlegroups.com.
> To post to this group, send email to mongo...@googlegroups.com.
> Visit this group at https://groups.google.com/group/mongodb-dev.
> For more options, visit https://groups.google.com/d/optout.



--
Asya Kamsky
Lead Product Manager
MongoDB
Download MongoDB - mongodb.org/downloads
Free MongoDB Monitoring - cloud.mongodb.com
Free Online Education - university.mongodb.com
Get Involved - mongodb.org/community
We're Hiring! - https://www.mongodb.com/careers
Reply all
Reply to author
Forward
0 new messages