1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00

vacuum: disabling vacuuming during a freeze

We shouldn't even think about vacuuming when we've frozen the database
(which is earlier than when we set CTDB_RECOVERY_ACTIVE)

CQ:S1018154 & S1018349
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

(This used to be ctdb commit d8df6835a931082af232c4b94f1dede6f16169f9)
This commit is contained in:
Rusty Russell 2010-07-21 12:28:04 +09:30
parent 0b07f91d36
commit 5f2d43157d

View File

@ -808,8 +808,14 @@ ctdb_vacuum_event(struct event_context *ev, struct timed_event *te,
struct ctdb_vacuum_child_context *child_ctx;
int ret;
/* we dont vacuum if we are in recovery mode */
if (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE) {
/* we dont vacuum if we are in recovery mode, or db frozen */
if (ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE ||
ctdb->freeze_mode[ctdb_db->priority] != CTDB_FREEZE_NONE) {
DEBUG(DEBUG_INFO, ("Not vacuuming %s (%s)\n", ctdb_db->db_name,
ctdb->recovery_mode == CTDB_RECOVERY_ACTIVE ? "in recovery"
: ctdb->freeze_mode[ctdb_db->priority] == CTDB_FREEZE_PENDING
? "freeze pending"
: "frozen"));
event_add_timed(ctdb->ev, vacuum_handle, timeval_current_ofs(ctdb->tunable.vacuum_default_interval, 0), ctdb_vacuum_event, vacuum_handle);
return;
}