The following test ( test_compact13.py ) seems to keep compaction stuck in the estimating phase for a while and nothing happens until suddenly, the pages skipped are equal to the pages reviewed.
The following code diff is needed to make sure the writers have time to fill up the free space before compaction can use it and we want to skip the HS so background compaction focuses straight away on the table created by the test:
diff --git a/src/btree/bt_compact.c b/src/btree/bt_compact.c index 41fc798964..c476a672d4 100644 --- a/src/btree/bt_compact.c +++ b/src/btree/bt_compact.c @@ -366,6 +366,11 @@ __wt_compact(WT_SESSION_IMPL *session) * Periodically check if compaction has been interrupted or if eviction is stuck, quit if * this is the case. */ + if(first) { + printf("Sleeping...\n"); + __wt_sleep(5, 0); + printf("Sleeping done!\n"); + } if (first || ++i > 100) { if (!first) bm->compact_progress(bm, session); diff --git a/src/session/session_compact.c b/src/session/session_compact.c index 132c147466..7d77d76b25 100644 --- a/src/session/session_compact.c +++ b/src/session/session_compact.c @@ -391,6 +391,9 @@ __wt_compact_check_eligibility(WT_SESSION_IMPL *session, const char *uri) { WT_UNUSED(session); + if (WT_STREQ(uri, WT_HS_URI)) + return (false); + /* Tiered tables cannot be compacted. */ if (WT_SUFFIX_MATCH(uri, ".wtobj")) return (false);
- is related to
-
SERVER-80124 Measure performance impact of background compaction
- Closed