Revisions Bin Cleaner



The revisions bin cleaner

Each entry in the Revisions Bin represents a "Delete Revision", which is a revision that marks a document as deleted and provides access to the revisions that were created for the document before it was deleted.

When the cleaner removes a "Delete Revision" entry,
ALL the revisions associated with the deleted document are permanently deleted.


  • The Revisions Bin Cleaner is configured with the following parameters:

    • Frequency - How often the cleaner runs.
    • Entries age to keep - The cleaner deletes revision entries older than this value.
  • The cleaner task can be managed from:

  • When working with a secure server:

    • Configuring the Revisions Bin Cleaner is logged in the audit log.
    • Deleting revisions is only available to a client certificate with a security clearance of Database Admin or higher.

Setting the revisions bin cleaner - from the Studio

Revisions bin cleaner view

Revisions Bin Cleaner View

  1. Go to Settings > Revisions Bin Cleaner
  2. Toggle ON to enable the cleaner task.
  3. Set the minimum entries age to keep:
    • When toggled ON:
      • Revisions Bin entries older than this value will be deleted.
      • Default: 30 days.
    • When toggled OFF:
      • ALL Revisions Bin entries will be deleted.
  4. Set the custom cleaner frequency:
    • Define how often (in seconds) the Revisions Bin Cleaner runs.
    • Default: 300 seconds (5 minutes).

Setting the revisions bin cleaner - from the Client API

  • Use ConfigureRevisionsBinCleanerOperation to configure the Revisions Bin Cleaner from the Client API.

  • By default, the operation will be applied to the default database.
    To operate on a different database see switch operations to different database.

  • In this example, we enable the cleaner and configure its execution frequency and retention policy.

    //Define the revisions bin cleaner configuration
    var config = new RevisionsBinConfiguration()
    {
        // Enable the cleaner
        Disabled = false,
    
        // Set the cleaner execution frequency
        CleanerFrequencyInSec = 24 * 60 * 60, // one day (in seconds)
        
        // Revisions bin entries older than the following value will be deleted
        MinimumEntriesAgeToKeepInMin = 24 * 60 // one day (in minutes)
    };
    
    // Define the operation
    var configRevisionsBinCleanerOp = new ConfigureRevisionsBinCleanerOperation(config);
    
    // Execute the operation by passing it to Maintenance.Send
    store.Maintenance.Send(configRevisionsBinCleanerOp);
    var config = new RevisionsBinConfiguration()
    {
        Disabled = false,
        CleanerFrequencyInSec = 24 * 60 * 60,
        MinimumEntriesAgeToKeepInMin = 24 * 60 
    };
    
    var configRevisionsBinCleanerOp = new ConfigureRevisionsBinCleanerOperation(config);
    await store.Maintenance.SendAsync(configRevisionsBinCleanerOp);

Syntax

public ConfigureRevisionsBinCleanerOperation(RevisionsBinConfiguration configuration);
public class RevisionsBinConfiguration
{
    // Set to true to enable the revisions bin cleaner.
    // Default: false (cleaner is disabled).
    public bool Disabled { get; set; }
    
    // The minimum age (in minutes) for revisions-bin entries to be kept in the database.
    // The cleaner deletes entries older than this value.
    // When set to 0: ALL revisions-bin entries will be removed from the Revisions Bin
    // Default: 30 days.
    public int MinimumEntriesAgeToKeepInMin { get; set; }
    
    // The frequency (in seconds) at which the revisions bin cleaner executes.
    // Default: 300 seconds (5 minutes).
    public long CleanerFrequencyInSec { get; set; } = 5 * 60;
}