Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
241be56b
Commit
241be56b
authored
Jan 10, 2024
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
expire: New MAIN.n_superseded counter
parent
e8264aaf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
6 deletions
+16
-6
cache_expire.c
bin/varnishd/cache/cache_expire.c
+5
-1
cache_hash.c
bin/varnishd/cache/cache_hash.c
+4
-4
cache_varnishd.h
bin/varnishd/cache/cache_varnishd.h
+1
-1
VSC_main.vsc
lib/libvsc/VSC_main.vsc
+6
-0
No files found.
bin/varnishd/cache/cache_expire.c
View file @
241be56b
...
...
@@ -149,12 +149,16 @@ EXP_RefNewObjcore(struct objcore *oc)
*/
void
EXP_Remove
(
struct
objcore
*
oc
)
EXP_Remove
(
struct
objcore
*
oc
,
const
struct
objcore
*
new_oc
)
{
CHECK_OBJ_NOTNULL
(
oc
,
OBJCORE_MAGIC
);
CHECK_OBJ_ORNULL
(
new_oc
,
OBJCORE_MAGIC
);
if
(
oc
->
exp_flags
&
OC_EF_REFD
)
{
Lck_Lock
(
&
exphdl
->
mtx
);
if
(
new_oc
!=
NULL
)
VSC_C_main
->
n_superseded
++
;
if
(
oc
->
exp_flags
&
OC_EF_NEW
)
{
/* EXP_Insert has not been called for this object
* yet. Mark it for removal, and EXP_Insert will
...
...
bin/varnishd/cache/cache_hash.c
View file @
241be56b
...
...
@@ -453,7 +453,7 @@ HSH_Lookup(struct req *req, struct objcore **ocp, struct objcore **bocp)
if
(
BAN_CheckObject
(
wrk
,
oc
,
req
))
{
oc
->
flags
|=
OC_F_DYING
;
EXP_Remove
(
oc
);
EXP_Remove
(
oc
,
NULL
);
continue
;
}
...
...
@@ -743,7 +743,7 @@ HSH_Purge(struct worker *wrk, struct objhead *oh, vtim_real ttl_now,
for
(
i
=
0
;
i
<
j
;
i
++
)
{
CHECK_OBJ_NOTNULL
(
ocp
[
i
],
OBJCORE_MAGIC
);
if
(
is_purge
)
EXP_Remove
(
ocp
[
i
]);
EXP_Remove
(
ocp
[
i
]
,
NULL
);
else
EXP_Rearm
(
ocp
[
i
],
ttl_now
,
ttl
,
grace
,
keep
);
(
void
)
HSH_DerefObjCore
(
wrk
,
&
ocp
[
i
],
0
);
...
...
@@ -919,7 +919,7 @@ HSH_Kill(struct objcore *oc)
Lck_Lock
(
&
oc
->
objhead
->
mtx
);
oc
->
flags
|=
OC_F_DYING
;
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
EXP_Remove
(
oc
);
EXP_Remove
(
oc
,
NULL
);
}
/*====================================================================
...
...
@@ -946,7 +946,7 @@ HSH_Snipe(const struct worker *wrk, struct objcore *oc)
Lck_Unlock
(
&
oc
->
objhead
->
mtx
);
}
if
(
retval
)
EXP_Remove
(
oc
);
EXP_Remove
(
oc
,
NULL
);
return
(
retval
);
}
...
...
bin/varnishd/cache/cache_varnishd.h
View file @
241be56b
...
...
@@ -207,7 +207,7 @@ vtim_real EXP_Ttl(const struct req *, const struct objcore *);
vtim_real
EXP_Ttl_grace
(
const
struct
req
*
,
const
struct
objcore
*
oc
);
void
EXP_RefNewObjcore
(
struct
objcore
*
);
void
EXP_Insert
(
struct
worker
*
wrk
,
struct
objcore
*
oc
);
void
EXP_Remove
(
struct
objcore
*
);
void
EXP_Remove
(
struct
objcore
*
,
const
struct
objcore
*
);
#define EXP_Dttl(req, oc) (oc->ttl - (req->t_req - oc->t_origin))
...
...
lib/libvsc/VSC_main.vsc
View file @
241be56b
...
...
@@ -397,6 +397,12 @@
Number of objects that expired from cache because of old age.
.. varnish_vsc:: n_superseded
:level: diag
:oneliner: Number of superseded objects
Number of times an object was superseded by a new one.
.. varnish_vsc:: n_lru_nuked
:oneliner: Number of LRU nuked objects
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment