V4 VCL roadmappery...

Poul-Henning Kamp phk at phk.freebsd.dk
Sun Apr 7 22:20:45 CEST 2013


I have tried to distill the new vcl_lookup{} into one easy to understand
ASCII-graph (if you can't document it etc...)

   vcl_hash{}
       |
       |
       v
   ALWYAS_MISS ? --- N ----+
       |                   |
       |                   v
       |                lookup()
       |                   |
       v                   v
    "MISS" <-----------+---+------------+---------------+--------------+
       |               |                |               |              |
       |               v                v               v              v
       |           "BUSY ONLY"    "EXPIRED+BUSY"    "EXPIRED"        "HIT"
       |               |                |               |              |
       v               v                v               v              |
       +<--- Y ----IGNORE_BUSY ?   IGNORE_BUSY? -- Y -->+              |
       |               |                |               |              |
       v               N                N               v              | 
    insert             |                |            insert            | 
    our busyobj        v                |           our busyobj        |
       |          [WAITING LIST]        |               |              |
       |                                |               |              |
       |                                v               v              v
       +--------->  ret(bo)        ret(exp_obj)   ret(exp_obj+bo)  ret(obj)
		      |                 |               |              |
		      |                 |               |              |
		      |                 |               |              |
   vcl_lookup{}       |                 |               |              |
   returns            |                 |               |              |
     |                |                 |               |              |
     v                v                 v               v              v
   pass
		   unbusy                            unbusy        
		   fetch(pass)      fetch(pass)      fetch(pass)   fetch(pass)
		   deliver          deliver          deliver       deliver

   synth
		   unbusy                            unbusy        
		   synth            synth            synth         synth

   deliver         fetch            stream           fetch         deliver obj
		   deliver          busyobj          deliver


   deliver_stale   fetch            deliver          bg-fetch      deliver obj
		   deliver             exp_obj       deliver
							exp_obj

There is a footnote that I simply could not get in there: hit_for_pass
objects.

If vcl_lookup{} returns deliver or deliver_stale on one such, it will
be converted to "pass" and a SLT_VCL_Error will be logged.

That leaves one interesting corner case:  A hit-for-pass object has
expired but is still in cache and we come down the "EXPIRED" path
where we insert our own busyobj, expecting to refresh the cache
with our own fetch.

Ideally, we should keep that busyobject in there, do the fetch(pass)
and if the object still qualifies for hit-for-pass, mark the
busyobj as such, so that there is never a gap where we take a MISS
on a hit-for-pass.

If that's trivial, I'll do it, of not, I wont.

Comments etc...

-- 
Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
phk at FreeBSD.ORG         | TCP/IP since RFC 956
FreeBSD committer       | BSD since 4.3-tahoe    
Never attribute to malice what can adequately be explained by incompetence.



More information about the varnish-dev mailing list