From 2e771b8073ab845872dafe484475a6eb7050a295 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Wed, 21 Jul 2010 12:28:04 +0930 Subject: [PATCH] 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 --- server/ctdb_vacuum.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c index 2f751b32..6ff8eb1a 100644 --- a/server/ctdb_vacuum.c +++ b/server/ctdb_vacuum.c @@ -803,8 +803,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; } -- 2.34.1