CouchDB 3.2 disable auto compaction for a specific database

398 Views Asked by At

How can I disable auto compaction in couchdb 3.2? I want to preserve all the history for a specific database. Or completely disable auto compaction.

note) couchdb(3.2) configuration has changed from 2.0

1

There are 1 best solutions below

0
Zeta On

I got an answer from github issue page.(https://github.com/apache/couchdb-documentation/issues/734) Below is the contents.


We do not advise pausing compaction to preserve the history of database. Once database revisions reach past 1000 (_revs_limit) they will start to be removed anyway. Database history should be preserved by the application. When documents are updated, can create a separate document with the old contents and link them together with an ID.

Compaction can be disabled if there is an operational issue of some sort, There is a [smoosh.ignore] $dbshard = true configuration value which can be set for individual shards. For instance:

[smoosh.ignore]
shards/80000000-ffffffff/db1.1122445 = true

But you'll have to list all the db shards there.

If you want to disable all dbs compaction can try:

[smoosh]
db_channels = upgrade_dbs