ctdb-vacuum: Do not delete VACUUM MIGRATED records immediately
authorAmitay Isaacs <amitay@gmail.com>
Mon, 14 Apr 2014 04:53:25 +0000 (14:53 +1000)
committerKarolin Seeger <kseeger@samba.org>
Wed, 10 Dec 2014 19:56:08 +0000 (20:56 +0100)
Such records should be processed by the local vacuuming daemon to ensure
that all the remote copies have been deleted first.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 257311e337065f089df688cbf261d2577949203d)

ctdb/server/ctdb_ltdb_server.c

index 8fb2bc7ce910900ee4e2892b3e26f70e339558d9..9ac2217a34a8251d6997e758c64fbc3ae18898fd 100644 (file)
@@ -115,6 +115,11 @@ static int ctdb_ltdb_store_server(struct ctdb_db_context *ctdb_db,
                 * fails. So storing the empty record makes sure that we do not
                 * need to change the client code.
                 */
+               if ((header->flags & CTDB_REC_FLAG_VACUUM_MIGRATED) &&
+                   (ctdb_db->ctdb->pnn == header->dmaster)) {
+                       keep = true;
+                       schedule_for_deletion = true;
+               }
                if (!(header->flags & CTDB_REC_FLAG_VACUUM_MIGRATED)) {
                        keep = true;
                } else if (ctdb_db->ctdb->pnn != header->dmaster) {