mirror of
https://github.com/schoebel/mars
synced 2025-02-17 12:37:20 +00:00
never switch over logfiles when /mars/ is exhausted
This commit is contained in:
parent
d16978d445
commit
4016261bae
@ -672,7 +672,7 @@ int __make_copy(
|
||||
(const struct generic_brick_type*)©_brick_type,
|
||||
(const struct generic_brick_type*[]){NULL,NULL,NULL,NULL},
|
||||
"%s",
|
||||
EXHAUSTED(global->remaining_space) ? -1 : 0,
|
||||
global->exhausted ? -1 : 0,
|
||||
"%s",
|
||||
(const char *[]){"%s", "%s", "%s", "%s"},
|
||||
4,
|
||||
@ -1927,7 +1927,9 @@ int _make_logging_status(struct mars_rotate *rot)
|
||||
* Allow switching over to a new logfile.
|
||||
*/
|
||||
if (!trans_brick->power.button && !trans_brick->power.led_on && trans_brick->power.led_off) {
|
||||
if (rot->next_relevant_log) {
|
||||
if (global->exhausted) {
|
||||
MARS_DBG("filesystem is exhausted, refraining from log rotation\n");
|
||||
} else if (rot->next_relevant_log) {
|
||||
MARS_DBG("check switchover from '%s' to '%s'\n", dent->d_path, rot->next_relevant_log->d_path);
|
||||
if (_check_versionlink(global, parent->d_path, dent->d_serial, end_pos) > 0) {
|
||||
MARS_DBG("switching over from '%s' to next relevant transaction log '%s'\n", dent->d_path, rot->next_relevant_log->d_path);
|
||||
@ -2474,7 +2476,7 @@ int make_dev(void *buf, struct mars_dent *dent)
|
||||
(rot->todo_primary &&
|
||||
!rot->trans_brick->do_replay &&
|
||||
rot->trans_brick->power.led_on);
|
||||
if (!global->global_power.button || EXHAUSTED(global->remaining_space)) {
|
||||
if (!global->global_power.button || global->exhausted) {
|
||||
switch_on = false;
|
||||
}
|
||||
|
||||
@ -3416,6 +3418,7 @@ static int light_thread(void *data)
|
||||
|
||||
_global.remaining_space = mars_remaining_space("/mars");
|
||||
exhausted = EXHAUSTED(_global.remaining_space);
|
||||
_global.exhausted = exhausted;
|
||||
_make_alivelink("exhausted", exhausted);
|
||||
if (exhausted)
|
||||
MARS_WRN("EXHAUSTED filesystem space = %lld, STOPPING IO\n", _global.remaining_space);
|
||||
|
@ -56,6 +56,7 @@ struct mars_global {
|
||||
loff_t remaining_space;
|
||||
int global_version;
|
||||
volatile bool main_trigger;
|
||||
bool exhausted;
|
||||
};
|
||||
|
||||
typedef int (*mars_dent_checker_fn)(struct mars_dent *parent, const char *name, int namlen, unsigned int d_type, int *prefix, int *serial);
|
||||
|
Loading…
Reference in New Issue
Block a user