mirror of https://github.com/schoebel/mars
light: less side effects by emergency mode
This commit is contained in:
parent
c81ad56480
commit
092201decc
|
@ -13148,10 +13148,7 @@ status open
|
|||
\begin_inset Newline newline
|
||||
\end_inset
|
||||
|
||||
all locally secondary resources will stop fetching transaction logfiles.
|
||||
As a side effect, other nodes in the cluster may become unable to delete
|
||||
their logfiles also.
|
||||
This is a desperate action of the kernel module.
|
||||
a warning will be issued.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Enumerate
|
||||
|
@ -13204,9 +13201,9 @@ status open
|
|||
\begin_inset Newline newline
|
||||
\end_inset
|
||||
|
||||
all locally secondary resources will start removing any logfiles which are
|
||||
no longer used locally.
|
||||
This is a more desperate action of the kernel module.
|
||||
all locally secondary resources will delete local copies of transaction
|
||||
logfiles which are no longer needed locally.
|
||||
This is a desperate action of the kernel module.
|
||||
\end_layout
|
||||
|
||||
\begin_layout Enumerate
|
||||
|
@ -13244,41 +13241,13 @@ status open
|
|||
\begin_inset Newline newline
|
||||
\end_inset
|
||||
|
||||
all locally primary resources are checked for logfiles which are no longer
|
||||
needed
|
||||
\emph on
|
||||
locally
|
||||
\emph default
|
||||
.
|
||||
Locally unneeded files are deleted even when some secondary needs them.
|
||||
As a consequence, some secondaries may get stuck (left in consistent, but
|
||||
outdated state).
|
||||
In order to get them actual again, they will need a
|
||||
\family typewriter
|
||||
marsadm invalidate
|
||||
\family default
|
||||
later (if there is no split brain; otherwise you might need the
|
||||
\family typewriter
|
||||
leave-resource
|
||||
\family default
|
||||
;
|
||||
\family typewriter
|
||||
join-resource
|
||||
\family default
|
||||
method from section
|
||||
\begin_inset CommandInset ref
|
||||
LatexCommand ref
|
||||
reference "sub:Split-Brain-Resolution"
|
||||
|
||||
\end_inset
|
||||
|
||||
).
|
||||
This is an even more desperate action of the kernel module.
|
||||
all locally secondary resources will stop fetching transaction logfiles.
|
||||
This is a more desperate action of the kernel module.
|
||||
You don't want to get there (except for testing).
|
||||
\end_layout
|
||||
|
||||
\begin_layout Enumerate
|
||||
Last desperate kernelspace action when all other has failed and
|
||||
Last desperate kernelspace action when all else has failed and
|
||||
\family typewriter
|
||||
|
||||
\begin_inset Flex URL
|
||||
|
|
|
@ -1530,7 +1530,7 @@ int __make_copy(
|
|||
cc.fullpath[1],
|
||||
(const struct generic_brick_type*)©_brick_type,
|
||||
(const struct generic_brick_type*[]){NULL,NULL,NULL,NULL},
|
||||
(!switch_copy || (IS_EXHAUSTED() && !space_using_mode) || IS_EMERGENCY_PRIMARY()) ? -1 : 2,
|
||||
(!switch_copy || (IS_EMERGENCY_PRIMARY() && !space_using_mode)) ? -1 : 2,
|
||||
"%s",
|
||||
(const char *[]){"%s", "%s", "%s", "%s"},
|
||||
4,
|
||||
|
@ -3563,23 +3563,27 @@ int make_log_finalize(struct mars_global *global, struct mars_dent *dent)
|
|||
rot->created_hole = false;
|
||||
}
|
||||
|
||||
if (IS_EMERGENCY_PRIMARY() || (!rot->todo_primary && IS_EMERGENCY_SECONDARY())) {
|
||||
MARS_WRN_TO(rot->log_say, "EMERGENCY: the space on /mars/ is very low. Expect some problems!\n");
|
||||
if (rot->first_log && rot->first_log != rot->relevant_log) {
|
||||
if (IS_EMERGENCY_SECONDARY()) {
|
||||
if (!rot->todo_primary && rot->first_log && rot->first_log != rot->relevant_log) {
|
||||
MARS_WRN_TO(rot->log_say, "EMERGENCY: ruthlessly freeing old logfile '%s', don't cry on any ramifications.\n", rot->first_log->d_path);
|
||||
make_rot_msg(rot, "wrn-space-low", "EMERGENCY: ruthlessly freeing old logfile '%s'", rot->first_log->d_path);
|
||||
mars_unlink(rot->first_log->d_path);
|
||||
rot->first_log->d_killme = true;
|
||||
// give it a chance to cease deleting next time
|
||||
compute_emergency_mode();
|
||||
} else if (IS_EMERGENCY_PRIMARY()) {
|
||||
MARS_WRN_TO(rot->log_say, "EMERGENCY: the space on /mars/ is VERY low.\n");
|
||||
make_rot_msg(rot, "wrn-space-low", "EMERGENCY: the space on /mars/ is VERY low.");
|
||||
} else {
|
||||
make_rot_msg(rot, "wrn-space-low", "EMERGENCY: the space on /mars/ is very low. Expect some problems!");
|
||||
MARS_WRN_TO(rot->log_say, "EMERGENCY: the space on /mars/ is low.\n");
|
||||
make_rot_msg(rot, "wrn-space-low", "EMERGENCY: the space on /mars/ is low.");
|
||||
}
|
||||
} else if (IS_EXHAUSTED()) {
|
||||
MARS_WRN_TO(rot->log_say, "EMERGENCY: the space on /mars/ is becoming low. Stopping all fetches of logfiles for secondary resources.\n");
|
||||
make_rot_msg(rot, "wrn-space-low", "EMERGENCY: the space on /mars/ is becoming low. Stopping all fetches of logfiles for secondary resources.");
|
||||
MARS_WRN_TO(rot->log_say, "EMERGENCY: the space on /mars/ is becoming low.\n");
|
||||
make_rot_msg(rot, "wrn-space-low", "EMERGENCY: the space on /mars/ is becoming low.");
|
||||
}
|
||||
|
||||
|
||||
if (trans_brick->replay_mode) {
|
||||
if (trans_brick->replay_code > 0) {
|
||||
MARS_INF_TO(rot->log_say, "logfile replay ended successfully at position %lld\n", trans_brick->replay_current_pos);
|
||||
|
|
Loading…
Reference in New Issue