-
Type:
Technical Debt
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Compaction
-
Storage Engines
-
2024-03-05 - Claronald
-
2
The following code can be refactored to avoid duplication:
if (block->compact_pages_rewritten_expected == 0) {
__wt_verbose_debug1(session, WT_VERB_COMPACT_PROGRESS,
"compacting %s for %" PRIu64 " seconds; reviewed %" PRIu64
" pages, rewritten %" PRIu64 " pages (%" PRIu64 "MB)",
block->name, time_diff, block->compact_pages_reviewed, block->compact_pages_rewritten,
block->compact_bytes_rewritten / WT_MEGABYTE);
__wt_verbose_debug1(session, WT_VERB_COMPACT,
"%s: still collecting information for estimating the progress", block->name);
} else {
progress = WT_MIN(
(int)(100 * block->compact_pages_rewritten / block->compact_pages_rewritten_expected),
100);
__wt_verbose_debug1(session, WT_VERB_COMPACT_PROGRESS,
"compacting %s for %" PRIu64 " seconds; reviewed %" PRIu64
" pages, rewritten %" PRIu64 " pages (%" PRIu64 "MB), approx. %d%% done",
block->name, time_diff, block->compact_pages_reviewed, block->compact_pages_rewritten,
block->compact_bytes_rewritten / WT_MEGABYTE, progress);
}