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

Force a page to split on release if greater than maxmempage size

    XMLWordPrintable

Details

    Description

      siddhartha.mahajan@mongodb.com found out while investigating WT-8707 that when a page is a candidate for forced eviction because it can be split in-memory, we fail to mark it to be evicted on release.

      __evict_force_check returns true if a page needs to be force evicted, false otherwise. When returning true, it also sets the page's read_gen to WT_READGEN_OLDEST to mark the page to be forcibly evicted. If a page is a candidate for an in-memory split, it is considered for forced eviction. But, __evict_force_check ends up not marking the page to be evicted soon (i.e. read gen to the oldest) and hence the page doesn't get a chance to be evicted when it gets released.

          /* If we can do an in-memory split, do it. */
          if (__wt_leaf_page_can_split(session, page))
              return (true);        <<<<<<<<<<<  Return true but fail to mark the page for forced eviction.
          if (footprint < btree->maxmempage)
              return (false);
       
          /* Bump the oldest ID, we're about to do some visibility checks. */
          WT_IGNORE_RET(__wt_txn_update_oldest(session, 0));
       
          /*
           * Allow some leeway if the transaction ID isn't moving forward since it is unlikely eviction
           * will be able to evict the page. Don't keep skipping the page indefinitely or large records
           * can lead to extremely large memory footprints.
           */
          if (!__wt_page_evict_retry(session, page))
              return (false);
       
          /* Trigger eviction on the next page release. */
          __wt_page_evict_soon(session, ref);    <<<<<<< Mark page for forced eviction on next release.
       
          /* If eviction cannot succeed, don't try. */
          return (__wt_page_can_evict(session, ref, NULL));
      

      Sid says fixing __evict_force_check helps with the regression that motivated WT-8707.

      Change suggested:
      Mark the page to be evicted soon in __evict_force_check when an in-memory split can succeed.

      Testing:
      WT and MongoDB performance tests (independent of impact due to changes from WT-8707).

      Attachments

        Issue Links

          Activity

            People

              backlog-server-storage-engines Backlog - Storage Engines Team
              sulabh.mahajan@mongodb.com Sulabh Mahajan
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: