Page MenuHomePhabricator

Sort out vcl_deliver vs vcl_synth mess with v4 VCL
Closed, ResolvedPublic

Description

In Varnish3, all outbound requests ultimately ran through vcl_deliver on their way out. With Varnish4, several classes of response do not pass through vcl_deliver and instead use vcl_synth as an alternative code path. Those classes include:

  • synthetic response from vcl_recv and/or vcl_hash
  • backend fetch failures
  • PURGE

We have a lot of code hooked into vcl_deliver, and much of it (but probably not all) should also be invoked for the vcl_synth path for non-PURGE requests, for things like X-Cache, X-Analytics, HSTS-setting, etc. It's a little bit complicated to untangle this, but we need to.

Event Timeline

Actually it doesn't turn out to be as messy as it seems at first. It's mostly the analytics, debugging, etc headers in common code that need invocation in vcl_synth, but nothing cluster-specific seems critical yet.

Change 289588 had a related patch set uploaded (by BBlack):
VCL: v4 deliver synth refactoring

https://gerrit.wikimedia.org/r/289588

Change 289588 merged by BBlack:
VCL: v4 deliver synth refactoring

https://gerrit.wikimedia.org/r/289588

BBlack claimed this task.