Commit e8e208b1 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Fix the "shortlived" test to look a the sum of ttl + grace + keep

rather than just the ttl.

Fixes		#1268
Spotted by:	daghf
Partial fix by:	gquintard
parent d89bbe7f
......@@ -370,7 +370,8 @@ vbf_stp_fetch(struct worker *wrk, struct busyobj *bo)
if (bo->uncacheable)
bo->fetch_objcore->flags |= OC_F_PASS;
if (bo->exp.ttl < cache_param->shortlived || bo->uncacheable == 1)
if (bo->uncacheable ||
bo->exp.ttl+bo->exp.grace+bo->exp.keep < cache_param->shortlived)
bo->storage_hint = TRANSIENT_STORAGE;
AZ(bo->stats);
......
......@@ -537,8 +537,8 @@ struct parspec mgt_parspec[] = {
{ "shortlived", tweak_timeout,
&mgt_param.shortlived,
"0", NULL,
"Objects created with TTL shorter than this are always "
"put in transient storage.",
"Objects created with (ttl+grace+keep) shorter than this"
" are always put in transient storage.",
0,
"10.0", "s" },
{ "critbit_cooloff", tweak_timeout,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment