Joe McDonnell created IMPALA-10391:
--------------------------------------
Summary: LIRS cache edge case where there is exactly one
unprotected element
Key: IMPALA-10391
URL: https://issues.apache.org/jira/browse/IMPALA-10391
Project: IMPALA
Issue Type: Bug
Components: Backend
Affects Versions: Impala 4.0
Reporter: Joe McDonnell
The fix for IMPALA-10127 introduced an issue in this code:
{noformat}
// 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);{noformat}
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.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)