Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-10391

LIRS cache edge case where there is exactly one unprotected element

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • Impala 4.0.0
    • Impala 4.0.0
    • Backend
    • None
    • ghx-label-14

    Description

      The fix for IMPALA-10127 introduced an issue in this code:

                // If an UNPROTECTED entry is not on the recency list, then its new reuse
                // distance is longer than any of the PROTECTED entries. So, it remains
                // an UNPROTECTED entry, but it should be added back to the recency list and
                // readded as the most recent entry on the unprotected list.
                MoveToRecencyListBack(&tstate, e, false);
                RemoveFromUnprotectedList(e);
                AddToUnprotectedList(e);

      RemoveFromUnprotectedList would detect that this is the last unprotected entry and clear unprotected_list_front_. This doesn't decrement num_unprotected_ to 0, so when AddToUnprotectedList is called, it doesn't set unprotected_list_front_ when it adds the element back.

      This only applies when there is exactly one entry on the unprotected list. This can be fixed by either decrementing/incrementing the counters to match up with other locations or by skipping this code when num_unprotected_ == 1.

      Attachments

        Activity

          People

            joemcdonnell Joe McDonnell
            joemcdonnell Joe McDonnell
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: