Bug where scrub eviction may be incorrectly set

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Works as Designed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Cache and Eviction
    • None
    • Storage Engines, Storage Engines - Transactions
    • SE Transactions - 2025-09-26
    • 1

      The change in WT-15210 may have introduced a bug where not scrub eviction may be incorrectly set because of a nested if statement. We should change this code from

      else if (bytes_inuse < (uint64_t)((target + trigger) * bytes_max) / 200) {
              if (F_ISSET_ATOMIC_32(
                    &(conn->cache->cache_eviction_controls), WT_CACHE_EVICT_SCRUB_UNDER_TARGET)) {
                  LF_SET(WT_EVICT_CACHE_SCRUB);
              } else if (bytes_dirty < (uint64_t)((dirty_target + dirty_trigger) * bytes_max) / 200 &&
                bytes_updates < (uint64_t)((updates_target + updates_trigger) * bytes_max) / 200) {
                  LF_SET(WT_EVICT_CACHE_SCRUB);
              }
      }

      to 

      else if (bytes_inuse < (uint64_t)((target + trigger) * bytes_max) / 200) {
              if (F_ISSET_ATOMIC_32(
                    &(conn->cache->cache_eviction_controls), WT_CACHE_EVICT_SCRUB_UNDER_TARGET)) {
                  LF_SET(WT_EVICT_CACHE_SCRUB);
              } else if (bytes_dirty < (uint64_t)((dirty_target + dirty_trigger) * bytes_max) / 200 &&
                bytes_updates < (uint64_t)((updates_target + updates_trigger) * bytes_max) / 200) {
                  LF_SET(WT_EVICT_CACHE_SCRUB);
              } else {
                  LF_SET(WT_EVICT_CACHE_NOKEEP);
      }

            Assignee:
            Alana Huang
            Reporter:
            Alana Huang
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: