Hi Matthieu,
I have a DB with several (quite big) collections, on Mongo 3.2.5 and WiredTiger with snappy compression on.
I would like to change the compression setting on one small collection I have to test it uncompressed. Is there a possibility to do that on a secondary without having to resync the whole DB?
It is not possible to change the block_compressor option of an existing collection.
However, you can create a new collection with the required options and replace the old collection:
db.createCollection( "uncompressed", { storageEngine: { wiredTiger: { configString: 'block_compressor=none' }}})
db.collection.renameCollection()
, so that the new collection replaces the old collection.Please note that by setting a custom field in the collection’s block_compressor
setting, this setting will be permanently set on the collection and cannot be overridden.
Is there a possibility to do that on a secondary without having to resync the whole DB?
It is possible to mix different storage engines in a replica set, but it is currently not possible (as of MongoDB 3.2) to set different storage engine options for a collection in a replica set. I.e., if you custom-specify a collection to use no compressor, the collection will not be using compression across all secondaries as well (since collection creation options are replicated to the secondaries, and cannot be changed once the collection is created).
Best regards,
Kevin