[squid-dev] [PATCH] Revalidate without Last-Modified

Amos Jeffries squid3 at treenet.co.nz
Tue Aug 23 15:17:16 UTC 2016


On 24/08/2016 12:07 a.m., Eduard Bagdasaryan wrote:
> 2016-08-21 15:58 GMT+03:00 Amos Jeffries <squid3 at treenet.co.nz>:
> 
>> To change anything between those markers we have to do a full cache
>> versioning and up/down-grade compatibility dance.
> 
> Could you please clarify what versioning problems you are talking
> about?  It
> seems that StoreEntry's STORE_META_STD fields are not used directly while
> storing/restoring metainformation. I found only places where field-by-field
> assignment is performed (e.g., InitStoreEntry::operator()), so making
> StoreEntry::lastmod 'private' should not do any harm there.  So probably we
> could mark with  "START OF ON-DISK STORE_META_STD TLV field" (or
> similar) the
> StoreEntry::lastmod, which is now private.

Yes I was referring to that block of members being read and written
directly to cache files. Either swap.state or the object metadata section.
I dont think they are referenced individully, but as a raw-pointer to
the first members address cast to some other identically laid out
StoreMeta* type (yucky).

The point of those comments AFAIK is to make it obvious that kind of
this is/was being done with them and prevent us doing what you did.

If that is no longer the case then the comments should be erased. But I
do not recall seeing anything changing the StoreMeta behaviours for UFS
format since I ran across the code. So its probably still going on, just
in a way thats not easily found.


The dance I referred to is adding +1 to the appropriate swap.state or
object TLV values and cleanly handle the older version objects being
loaded. They can be saved in new format of course.


> 
>> lastModifiedDelta() returning -1 when the actual delta is any -N value
>> is wrong conceptually. A delta should be the actual difference value
> -N < 0 < +N.
> 
> Since we need and use only the positive outcome of this method inside
> refreshStaleness(), probably rename it to ageWhenCached() (or similar)?
> Returning '-1' would mean that it is impossible to calculate the age
> ('lastmod'
> is absent or greater than timestamp).

Producing the actual delta -N value and checking >=0 should not be an
issue. Having the proper delta should be helpful when we fix the refresh
calculations.

Amos



More information about the squid-dev mailing list