[SERVER-80120] Add the new compaction "freeSpaceTargetMB" option to the compact API Created: 16/Aug/23  Updated: 07/Dec/23  Resolved: 18/Oct/23

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

Type: Task Priority: Major - P3
Reporter: Gregory Wlodarek Assignee: Sean Watt
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
depends on WT-11332 Update the compact session API with a... Closed
depends on SERVER-81177 Update the compact command with IDL Closed
Documented
Related
related to SERVER-82781 Simulate crash test hook may leave be... Closed
related to SERVER-82846 Add the new compaction "freeSpaceTarg... Closed
is related to WT-11821 WiredTiger data corruption detected i... Closed
Backwards Compatibility: Fully Compatible
Participants:
Story Points: 5

 Description   

The current compact command only takes in a collection name and runs compact against the collection and index tables as indicated in the existing documentation for MongoDB 6.0. This project modifies the API while ensuring backward compatibility by adding a new field indicating the minimum space compact should be able to reclaim.

A prototype of the API can be found below:

db.runCommand(
    {
        compact: <collection name>,
        freeSpaceTargetMB: <number>, // Optional, minimum space available to reclaim in MB, default is 20MB.
    }
)



 Comments   
Comment by Githook User [ 18/Oct/23 ]

Author:

{'name': 'Sean04', 'email': 'sean.watt@mongodb.com', 'username': 'Sean04'}

Message: SERVER-80120 Add the new compaction "freeSpaceTargetMB" option to the compact API
Branch: master
https://github.com/mongodb/mongo/commit/8d5d53c845bf9ed43a7ae18ec66f6c47d6916454

Comment by Sean Watt [ 13/Oct/23 ]

I modified the compact.js test while working on this ticket to include a remove state that creates free space in the collections, allowing compact to properly do work. This resulted in config_fuzzer_simulate_crash_concurrency_replication_gen failing with a corrupt block when the file is reopened. I've created WT-11821 to cover this investigation.

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