Commit ed4ed27f authored by Nils Goroll's avatar Nils Goroll

Introduce HSH_HITPASS and HSH_HITMISS and clarify grace/keep HSH_HITMISS

parent 9cb08c1d
......@@ -444,14 +444,14 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
VSLb(req->vsl, SLT_HitPass, "%u %.6f",
ObjGetXID(wrk, oc), EXP_Dttl(req, oc));
oc = NULL;
retval = HSH_MISS;
retval = HSH_HITPASS;
} else if (oc->flags & OC_F_HFM) {
wrk->stats->cache_hitmiss++;
VSLb(req->vsl, SLT_HitMiss, "%u %.6f",
ObjGetXID(wrk, oc), EXP_Dttl(req, oc));
*bocp = hsh_insert_busyobj(wrk, oh);
oc->refcnt++;
retval = HSH_MISS;
retval = HSH_HITMISS;
} else {
oc->refcnt++;
if (oc->hits < LONG_MAX)
......@@ -473,11 +473,17 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp,
}
if (exp_oc != NULL && exp_oc->flags & OC_F_HFM) {
/*
* expired HFM ("grace/keep HFM")
*
* XXX should HFM objects actually have grace/keep ?
*/
wrk->stats->cache_hitmiss++;
VSLb(req->vsl, SLT_HitMiss, "%u %.6f", ObjGetXID(wrk, exp_oc),
EXP_Dttl(req, exp_oc));
exp_oc = NULL;
busy_found = 0;
*bocp = hsh_insert_busyobj(wrk, oh);
Lck_Unlock(&oh->mtx);
return (HSH_HITMISS);
}
if (!busy_found) {
......
......@@ -503,21 +503,23 @@ cnt_lookup(struct worker *wrk, struct req *req)
}
AZ(req->objcore);
if (lr == HSH_MISS) {
if (busy != NULL) {
/* hitmiss, out-of-grace or ordinary miss */
AN(busy->flags & OC_F_BUSY);
req->objcore = busy;
req->stale_oc = oc;
req->req_step = R_STP_MISS;
} else {
/* hitpass */
AZ(oc);
req->req_step = R_STP_PASS;
}
if (lr == HSH_MISS || lr == HSH_HITMISS) {
AN(busy);
AN(busy->flags & OC_F_BUSY);
req->objcore = busy;
req->stale_oc = oc;
req->req_step = R_STP_MISS;
return (REQ_FSM_MORE);
}
if (lr == HSH_HITPASS) {
AZ(busy);
AZ(oc);
req->req_step = R_STP_PASS;
return (REQ_FSM_MORE);
}
assert(lr == HSH_HIT || lr == HSH_GRACE);
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
AZ(oc->flags & OC_F_BUSY);
req->objcore = oc;
......
......@@ -53,6 +53,8 @@ enum lookup_e {
HSH_MISS,
HSH_BUSY,
HSH_HIT,
HSH_HITMISS,
HSH_HITPASS,
HSH_GRACE
};
......
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