Detect if catalog is being created or opened in KVEngine

24 views
Skip to first unread message

Sandeep Joshi

unread,
May 12, 2016, 2:54:33 AM5/12/16
to mongodb-dev

At the storage engine layer (i.e. in KVEngine::createRecordStore/getRecordStore()), is there a way to detect if the system catalog is being created or opened ?

I can always check the incoming string against "_mdb_catalog" but that's a hack.

The string "_mdb_catalog" isn't available via a header file.  It is defined via the variable "catalogInfo" in a source file (kv_storage_engine.cpp)

-Sandeep



Michael Cahill

unread,
May 18, 2016, 12:14:06 PM5/18/16
to mongodb-dev
Hi Sandeep,

You're right that there isn't a better solution today than checking for the name.  Would exporting a constant in kv_engine.h be a reasonable solution?

Out of interest, can I ask what you want to do specially for the catalog in the storage engine?  You can of course avoid the "kv" code and implement the lower-level storage engine API if you want to manage the catalog yourself.

Thanks,
Michael.

Sandeep Joshi

unread,
May 19, 2016, 12:20:40 AM5/19/16
to mongo...@googlegroups.com

Mike,

thanks for responding ! 
Comments in text..

On Wed, May 18, 2016 at 9:44 PM, Michael Cahill <michael...@mongodb.com> wrote:
Hi Sandeep,

You're right that there isn't a better solution today than checking for the name.  Would exporting a constant in kv_engine.h be a reasonable solution?


Yes, that would work.   I can submit a patch if this solution is acceptable.
I suppose there is no encapsulation like NamespaceString which could be used in this case.

 

Out of interest, can I ask what you want to do specially for the catalog in the storage engine?  You can of course avoid the "kv" code and implement the lower-level storage engine API if you want to manage the catalog yourself.


I am still experimenting but what I wanted is a way to process the catalog differently from the other collections inside mongo-rocks.

Mongo-rocks, as you may know, stores all collections (catalog, local oplog, collections, indices) into the same rocksdb column family. 

-Sandeep


 
Thanks,
Michael.

--
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/xCVVkXY9Xss/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.

Reply all
Reply to author
Forward
0 new messages