[SERVER-67726] Add mechanism to change compression of an existing collection Created: 01/Jul/22  Updated: 05/Jul/22  Resolved: 05/Jul/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Johnny Shields Assignee: Chris Kelly
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

I'd like to switch my database from Snappy to Zstd compression.
 
Currently, it doesn't seem that it is possible to change the compression of an existing collection.
 
It would be nice if there were a way to do this, even if (for example) it required making a new replica set member which "re-compresses" the data to the new algorithm while cloning it.
 
My account rep is recommending today that I create a new collection and manually copy with mongodump/mongorestore which doesn't seem to be a viable option, for data consistency reasons.



 Comments   
Comment by Johnny Shields [ 05/Jul/22 ]

Chris > thank you for clarifying. Will raise feedback.

Comment by Chris Kelly [ 05/Jul/22 ]

Johnny,

Thanks for you report. Changing the compression method of an existing collection is not something that is currently supported. However, you can request this feature over at feedback.mongodb.com. We're starting to direct new feature requests and improvements to that channel and preferring this JIRA project for bug reports specifically.

You may also want to search and post on the MongoDB Developer Community Forums, as it's possible there are others who have guidance on how to satisfy your use-case.

Compression settings are observed only during collection creation (see Compression 14). You can create a new collection with the parameters you need, as described in the Specify Storage Engine Options page.

db.createCollection( "uncompressed", { storageEngine: { wiredTiger: { configString: 'block_compressor=none' }}} 

You should be able to select zstd here. Mongodump/mongorestore seems like the most convenient option for this, short of writing something yourself that will manually replicate this data to another collection using the new compression method.

I'll close this for now, but if you would like to see this as a feature in the future, please mention it at feedback.mongodb.com to get it on the radar.

Regards,

Christopher

 

Generated at Thu Feb 08 06:08:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.