[SERVER-54378] Report useful information during the compact command Created: 08/Feb/21  Updated: 14/Nov/21  Resolved: 03/Nov/21

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

Type: Improvement Priority: Major - P3
Reporter: Dmitry Agranat Assignee: Ravi Giri
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-54196 WiredTiger compact command does not c... Closed
Related
is related to SERVER-54196 WiredTiger compact command does not c... Closed
Sprint: Storage - Ra 2021-11-15
Participants:
Story Points: 2

 Description   

Currently, if the compact does not meet any of the compact algorithm's conditions, we report back bytesFreed = 0.

It would be helpful to report back the information that is helpful to understand why the compact decided not to compact anything. Be it files too small (less than 1 MB), files where we are unlikely to recover 10% of the file or any other reason for that matter (since the compact algorithm could change over time).



 Comments   
Comment by Ravi Giri [ 03/Nov/21 ]

dmitry.agranat Yes, we have similar logging that prints the stats and then prints if 10% of the space is available or not and if compact can proceed or skip.

Below example when it compacts the files and later it gives up because compact cannot recover 10% or 3MB and hence compaction is skipped.

file:test_compact02.wt, WT_SESSION.compact: [WT_VERB_COMPACT] test_compact02.wt: total reviewed 2742 pages, total skipped 0 pages, total wrote 1783 pages
file:test_compact02.wt, WT_SESSION.compact: [WT_VERB_COMPACT] test_compact02.wt: 0MB (4096) available space in the first 80% of the file
file:test_compact02.wt, WT_SESSION.compact: [WT_VERB_COMPACT] test_compact02.wt: 0MB (4096) available space in the first 90% of the file
file:test_compact02.wt, WT_SESSION.compact: [WT_VERB_COMPACT] test_compact02.wt: require 10% or 3MB (3395174) in the first 90% of the file to perform compaction, compaction skipped

Comment by Ravi Giri [ 02/Nov/21 ]

dmitry.agranat
As part of PM-2054 we implemented additional logging(WT-8189) and stats(WT-6077) while running compact operation.

Addition loggings include when the compact quits early because the file size is less than 1 MB, compact quits early because of time out, etc.

Can we close this ticket if the details are sufficient?

Generated at Thu Feb 08 05:33:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.