]> err.no Git - varnish/commit
Finish (the "easy") part of degraded mode:
authorphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 28 Jan 2008 10:28:24 +0000 (10:28 +0000)
committerphk <phk@d4fa192b-c00b-0410-8231-f00ffab90ce4>
Mon, 28 Jan 2008 10:28:24 +0000 (10:28 +0000)
commit41072afb195b843807543d6df2a5f90699f2675c
treef0bccfc3bd0a201eec4a4ff3784e6449fbc5d6da
parent40a2703a36b1c5f0536a5b6152aa38995c76218f
Finish (the "easy") part of degraded mode:

Add req.grace timer:  We only serve degraded mode objects if both the
request and the object's grace timers are satisfied.

Sort expiry list on obj.ttl + obj.grace and fiddle list if either changes.

In the hash lookup: record if any objects still in grace by obj.grace which
match our Vary: criteria (if any).

If no in-ttl object was found AND we have a graced object AND it is also
graced by req.grace AND it is being fetched: serve the graced object.

Otherwise, mark us as successor to the graced object while we fetch to
give others the chance.

When we unbusy the object, clean the magic pointers between the two
objects again.

To play with this you need at least:

sub vcl_recv {
set req.grace = 2m;
}
sub vcl_fetch {
set obj.grace = 2m;
}

git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@2392 d4fa192b-c00b-0410-8231-f00ffab90ce4
varnish-cache/bin/varnishd/cache.h
varnish-cache/bin/varnishd/cache_expire.c
varnish-cache/bin/varnishd/cache_hash.c
varnish-cache/bin/varnishd/cache_vrt.c
varnish-cache/bin/varnishd/cache_ws.c
varnish-cache/include/vrt_obj.h
varnish-cache/lib/libvcl/vcc_fixed_token.c
varnish-cache/lib/libvcl/vcc_gen_obj.tcl
varnish-cache/lib/libvcl/vcc_obj.c