-
Notifications
You must be signed in to change notification settings - Fork 1.1k
How to Disable Automatic Compaction in CouchDB to Preserve Old Revisions #5960
Copy link
Copy link
Open
Labels
by-designBehaviour in question is by design.Behaviour in question is by design.
Description
Version
3.3.0
Title
How to Disable Automatic Compaction in CouchDB to Preserve Old Revisions
Description
Hi Team,
I’m working with CouchDB and need to retain older document revisions (_rev) for auditing and historical tracking purposes. However, I’ve observed that automatic compaction is removing old revisions, which is impacting my use case.
Requirement
I want to:
- Prevent CouchDB from deleting old revisions during compaction
- Access older
_revdata when needed
Current Behavior
- Automatic compaction is running in the background
- Old document revisions are being cleaned up after compaction
- Unable to retrieve previous revisions once compaction occurs
Expected Behavior
- Old revisions should be retained (or at least compaction should not run automatically)
- Compaction should only run manually when explicitly triggered
Questions
- How can I disable automatic compaction (Smoosh) in CouchDB?
- Is there a way to retain old revisions even after compaction?
- What configuration controls revision retention (
revs_limitor others)? - Are there recommended approaches for audit/history use cases in CouchDB?
What I’ve Explored
- Looked into CouchDB config files (
local.ini,default.ini) - Suspecting the Smoosh daemon is triggering auto compaction
- Aware of
_revs_limitbut unsure how it interacts with compaction
Environment
- CouchDB Version: (please specify)
- Deployment: (Docker / VM / Kubernetes / etc.)
Additional Context
This is part of a requirement where I need to track historical changes of documents, so losing old revisions is not acceptable.
Any guidance on best practices or configuration changes would be greatly appreciated.
Expected Behaviour
Old revisions should be retained (or at least compaction should not run automatically)
Compaction should only run manually when explicitly triggered
Steps to Reproduce
No response
Your Environment
No response
Additional Context
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
by-designBehaviour in question is by design.Behaviour in question is by design.
Type
Fields
Give feedbackNo fields configured for issues without a type.