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

Fix bug in picking random dhandle for eviction

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: WT3.2.1, 4.3.1, 4.2.0-rc2
    • Component/s: None
    • Labels:
    • Story Points:
      8
    • Sprint:
      Storage Engines 2019-06-17
    • Backport Requested:
      v4.2, v4.0

      Description

      Changes for WT-4732 introduced a mechanism to pick dhandles randomly for eviction. This was done to avoid following any specific pattern in choosing dhandles and hence be fair in our eviction policy.

      The dhandles are maintained in a global dhandle list as well as in a hash table with a fixed size of buckets (512), each bucket containing a list of dhandles (that hash collides) in that bucket. The change for WT-4732 was supposed to do the following:
      1. If there are less than a certain number of dhandles, walk the global list to a random dhandle
      2. If there are a large number of dhandles, pick a random dhandle bucket and then pick a random dhandle in that bucket's dhandle list.

      The changes introduced a bug in step 2, where after picking the random bucket, with say N dhandles in its list, instead of picking a random dhandle from among those N, it would pick a random dhandle from the next N in the global list. Hence limiting eviction to a small subset of dhandles in the global list.

      The above bug leads to eviction server's inability to find pages to evict and eventually cache gets full and workload stalls.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sulabh.mahajan Sulabh Mahajan
              Reporter:
              alex.cameron Alex Cameron (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              16 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: