Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-12314

Compaction stays stuck in the estimating phase

    • Storage Engines
    • 5
    • StorEng - 2024-01-23, 2024-02-06 tapioooooooooooooca

      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);
      

            Assignee:
            etienne.petrel@mongodb.com Etienne Petrel
            Reporter:
            etienne.petrel@mongodb.com Etienne Petrel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: