varnish-cache icon indicating copy to clipboard operation
varnish-cache copied to clipboard

Invalidate vxid caches when the vxid wraps

Open nigoroll opened this issue 4 years ago • 2 comments

To avoid vxid clashes, we add a vxid generation number which is increased every time the global vxid counter wraps.

Any vxid caches from a previous generation are invalidated.

This patch should fix #3775 if the latest hypothesis is correct that transaction inconsistencies in the vsl reader are caused by vxid clashes due to vxid caching on the varnishd side.

Implementation notes:

  • The global generation counter value is deliberately read outside the lock to keep the performance impact minimal. It should not matter if an outdated value is read momentarily, because the time scale of vxids is some orders of magintudes larger than that of SMP cache inconsistencies.

  • This implementation invalidates vxid caches earlier than it absolutely needed to, but I decided to go with this idea for its simplicity in contrast to calculating a distance between the global vxid base and the cached value.

nigoroll avatar Feb 14 '22 11:02 nigoroll

This change is made obsolete by plans to move to 64bit VXIDs, but I would like to keep it open until I port it to the 6.0 branch.

dridi avatar Jan 09 '23 14:01 dridi

I am going to flag it with r=6.0. Please close when done

nigoroll avatar May 08 '23 13:05 nigoroll