jplevyak commented on code in PR #13893:
URL: https://github.com/apache/trafficserver/pull/13893#discussion_r4368089529
##########
src/iocore/cache/RamCacheCLFUS.cc:
##########
@@ -880,13 +932,19 @@ RamCacheCLFUS::put(CryptoHash *key, IOBufferData *data,
uint32_t len, bool copy,
victim_value += cache_value(victim);
this->_tick();
if (!e) {
- goto Lhistory;
+ if (!seen_match) {
+ goto Lhistory;
+ }
+ if (this->_bytes + victim->size + size > this->_max_bytes &&
victim_value > cache_value_hits_size(1, size)) {
Review Comment:
Agreed, fixed in c25844539. put() now uses size + entry_overhead for the
candidate in every fit check, and adds the victim's entry_overhead in the two
restore-feasibility checks and in the Linsert restore check. Most of these
checks predate this PR, but the seen-match path had the same gap. The new test
`CLFUS admission accounts for per-entry overhead` reproduces your scenario
(three 8 KiB residents, 32 KiB cache, 7424-byte copy-in candidate): before the
fix it admitted the candidate and left _bytes at 33024; now the candidate goes
to history and _bytes stays within _max_bytes.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]