Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
6c6682cd
Unverified
Commit
6c6682cd
authored
Feb 04, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_log: rewrite the log for a clean shutdown
parent
b4881921
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
7 deletions
+22
-7
fellow_log.c
src/fellow_log.c
+14
-5
vmod_slash.man.rst
src/vmod_slash.man.rst
+4
-1
vmod_slash.vcc
src/vmod_slash.vcc
+4
-1
No files found.
src/fellow_log.c
View file @
6c6682cd
...
@@ -6110,11 +6110,13 @@ fellow_logwatcher_thread(void *priv)
...
@@ -6110,11 +6110,13 @@ fellow_logwatcher_thread(void *priv)
while
(
ffd
->
watcher_running
)
{
while
(
ffd
->
watcher_running
)
{
fellow_fd_update_space_stats
(
ffd
);
fellow_fd_update_space_stats
(
ffd
);
if
(
new_log_fdr
.
size
)
if
(
new_log_fdr
.
size
||
ffd
->
watcher_running
==
2
)
need
=
FLW_NEED_REWRITE
;
need
=
FLW_NEED_REWRITE
;
else
else
need
=
fellow_logwatcher_need
(
ffd
,
NULL
);
need
=
fellow_logwatcher_need
(
ffd
,
NULL
);
ffd
->
watcher_running
=
1
;
switch
(
need
)
{
switch
(
need
)
{
case
FLW_NEED_NONE
:
case
FLW_NEED_NONE
:
DBG
(
"logwatcher %s"
,
"FLW_NEED_NONE"
);
DBG
(
"logwatcher %s"
,
"FLW_NEED_NONE"
);
...
@@ -6140,10 +6142,7 @@ fellow_logwatcher_thread(void *priv)
...
@@ -6140,10 +6142,7 @@ fellow_logwatcher_thread(void *priv)
fellow_logwatcher_flush
(
ffd
,
0
);
fellow_logwatcher_flush
(
ffd
,
0
);
ffd
->
watcher_state
=
FLW_S_REWRITING
;
ffd
->
watcher_state
=
FLW_S_REWRITING
;
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
if
(
new_log_fdr
.
size
||
fellow_logs_rewrite
(
ffd
,
&
new_log_fdr
,
NULL
,
NULL
);
fellow_logwatcher_need
(
ffd
,
NULL
)
==
need
)
fellow_logs_rewrite
(
ffd
,
&
new_log_fdr
,
NULL
,
NULL
);
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
continue
;
continue
;
default:
default:
...
@@ -6221,10 +6220,20 @@ fellow_logwatcher_fini(struct fellow_fd *ffd)
...
@@ -6221,10 +6220,20 @@ fellow_logwatcher_fini(struct fellow_fd *ffd)
{
{
CHECK_OBJ_NOTNULL
(
ffd
,
FELLOW_FD_MAGIC
);
CHECK_OBJ_NOTNULL
(
ffd
,
FELLOW_FD_MAGIC
);
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
ffd
->
watcher_running
=
2
;
AZ
(
pthread_cond_signal
(
&
ffd
->
watcher_cond
));
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
while
(
ffd
->
watcher_running
==
2
)
(
void
)
usleep
(
100
*
1000
);
assert
(
ffd
->
watcher_running
==
1
);
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
ffd
->
watcher_running
=
0
;
ffd
->
watcher_running
=
0
;
AZ
(
pthread_cond_signal
(
&
ffd
->
watcher_cond
));
AZ
(
pthread_cond_signal
(
&
ffd
->
watcher_cond
));
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
AZ
(
pthread_join
(
ffd
->
watcher_thread
,
NULL
));
AZ
(
pthread_join
(
ffd
->
watcher_thread
,
NULL
));
AZ
(
pthread_cond_destroy
(
&
ffd
->
watcher_cond
));
AZ
(
pthread_cond_destroy
(
&
ffd
->
watcher_cond
));
}
}
...
...
src/vmod_slash.man.rst
View file @
6c6682cd
...
@@ -486,7 +486,10 @@ Resizing fellow storage
...
@@ -486,7 +486,10 @@ Resizing fellow storage
In general, resizing a fellow storage is supported by restarting
In general, resizing a fellow storage is supported by restarting
varnishd with different parameters (be it on the command line or in
varnishd with different parameters (be it on the command line or in
VCL), but for size reductions, cache contents may be lost, to the
VCL), but for size reductions, cache contents may be lost, to the
extent of all cache contents. Read this paragraph for details:
extent of all cache contents. Read this paragraph for details.
Before applying any size change, it is strongly recommended to cleanly
shut down fellow using ``varnishadm stop``.
Increasing ``memsize``
Increasing ``memsize``
...
...
src/vmod_slash.vcc
View file @
6c6682cd
...
@@ -432,7 +432,10 @@ Resizing fellow storage
...
@@ -432,7 +432,10 @@ Resizing fellow storage
In general, resizing a fellow storage is supported by restarting
In general, resizing a fellow storage is supported by restarting
varnishd with different parameters (be it on the command line or in
varnishd with different parameters (be it on the command line or in
VCL), but for size reductions, cache contents may be lost, to the
VCL), but for size reductions, cache contents may be lost, to the
extent of all cache contents. Read this paragraph for details:
extent of all cache contents. Read this paragraph for details.
Before applying any size change, it is strongly recommended to cleanly
shut down fellow using ``varnishadm stop``.
Increasing ``memsize``
Increasing ``memsize``
...
...
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