Grace and misbehaving servers
batanun at hotmail.com
Wed Mar 25 18:41:44 UTC 2020
On Mo, Mar 23, 2020 at 10:00 AM Dridi Boukelmoune <dridi at varni.sh> wrote:
> For starters, there currently is no way to know for sure that you
> entered vcl_synth because of a return(abandon) transition. There are
> plans to make it possible, but currently you can do that with
> confidence lower than 100%.
I see. I actually had a feeling about that, since I didn't see an obvious way to pass that kind of information into vcl_synth when triggered by an abandon.
Although, just having a general rule to restart 500-requests there, regardless of what caused it, is not really that bad anyway.
> A problem with the restart logic is the race it opens since you now
> have two lookups, but overall, that's the kind of convoluted VCL that
> should work. The devil might be in the details.
Could you describe this race condition that you mean can happen? What could the worst case scenario be? If it is just a guru meditation for this single request, and it happens very rarely, then that is something I can live with. If it is something that can cause Varnish to crash or hang, then it is not something I can live with :)
> In this case you might want to combine your VCL restart logic with
Yes, I have already heard some things about this vmod. I will definitely look into it. Thanks.
> And you might solve this problem with vmod_xkey!
We actually already use this vmod. But like I said, it doesn't solve the problem with new content that effects existing pages. Several pages might for example include information about the latest objects created in the system. If one of these pages were loaded and cached at time T1, and then at T2 a new object O2 was created, an "xkey purge" with the key "O2" will have no effect since that page was not associated with the "O2" key at time T1, because O2 didn't even exist then.
And since there is no way to know beforehand which these pages are, the only bullet proof way I can see of handling this is to purge all pages* any time any content is updated.
* or at least a large subset of all pages, since the vast majority might include something related to newly created objects
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the varnish-misc