X-Git-Url: http://git.samba.org/samba.git/?p=vlendec%2Fsamba-autobuild%2F.git;a=blobdiff_plain;f=ctdb%2Fserver%2Fctdb_vacuum.c;h=9d086917f3c47322cbd5e51c1771880a6cc63f50;hp=2194b7f4da75619195355b7fd979264ffe8e6236;hb=f1b594dce1c081924b16c52c8c50c984a16df098;hpb=9bdd6814e4c64f3be04daa7e8739e141d2d664b7 diff --git a/ctdb/server/ctdb_vacuum.c b/ctdb/server/ctdb_vacuum.c index 2194b7f4da7..9d086917f3c 100644 --- a/ctdb/server/ctdb_vacuum.c +++ b/ctdb/server/ctdb_vacuum.c @@ -1205,6 +1205,7 @@ static void ctdb_vacuum_event(struct tevent_context *ev, struct ctdb_context *ctdb = ctdb_db->ctdb; struct ctdb_vacuum_child_context *child_ctx; struct tevent_fd *fde; + bool full_vacuum_run = false; int ret; /* we don't vacuum if we are in recovery mode, or db frozen */ @@ -1247,7 +1248,11 @@ static void ctdb_vacuum_event(struct tevent_context *ev, return; } - if (vacuum_handle->fast_path_count > ctdb->tunable.vacuum_fast_path_count) { + if (vacuum_handle->fast_path_count >= + ctdb->tunable.vacuum_fast_path_count) { + if (ctdb->tunable.vacuum_fast_path_count > 0) { + full_vacuum_run = true; + } vacuum_handle->fast_path_count = 0; } @@ -1266,7 +1271,6 @@ static void ctdb_vacuum_event(struct tevent_context *ev, if (child_ctx->child_pid == 0) { char cc = 0; - bool full_vacuum_run = false; close(child_ctx->fd[0]); DEBUG(DEBUG_INFO,("Vacuuming child process %d for db %s started\n", getpid(), ctdb_db->db_name)); @@ -1276,11 +1280,6 @@ static void ctdb_vacuum_event(struct tevent_context *ev, _exit(1); } - if ((ctdb->tunable.vacuum_fast_path_count > 0) && - (vacuum_handle->fast_path_count == 0)) - { - full_vacuum_run = true; - } cc = ctdb_vacuum_and_repack_db(ctdb_db, full_vacuum_run); sys_write(child_ctx->fd[1], &cc, 1);