summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2010-12-17 02:22:02 +0100
committerMichael Adam <obnox@samba.org>2011-03-14 13:35:46 +0100
commita81f740f3dda9cff343640c5a726db5a0dc5fcd5 (patch)
treebf735ae4924f3ed57679fb5266c5cf4f6153e7d9
parent6a1cfe82f1b2d55ffd9e00f2a0731eef653ee76e (diff)
downloadsamba-a81f740f3dda9cff343640c5a726db5a0dc5fcd5.tar.gz
samba-a81f740f3dda9cff343640c5a726db5a0dc5fcd5.tar.xz
samba-a81f740f3dda9cff343640c5a726db5a0dc5fcd5.zip
When wiping a database, clear the delete_queue.
(This used to be ctdb commit 731a6011ce4a1301f86eacb039955745f2b5d866)
-rw-r--r--ctdb/server/ctdb_freeze.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_freeze.c b/ctdb/server/ctdb_freeze.c
index 86cb5edc12..0f70fd3502 100644
--- a/ctdb/server/ctdb_freeze.c
+++ b/ctdb/server/ctdb_freeze.c
@@ -25,6 +25,7 @@
#include "../include/ctdb_private.h"
#include "lib/util/dlinklist.h"
#include "db_wrap.h"
+#include "../common/rb_tree.h"
static bool later_db(const char *name)
{
@@ -605,5 +606,15 @@ int32_t ctdb_control_wipe_database(struct ctdb_context *ctdb, TDB_DATA indata)
return -1;
}
+ if (!ctdb_db->persistent) {
+ talloc_free(ctdb_db->delete_queue);
+ ctdb_db->delete_queue = trbt_create(ctdb_db, 0);
+ if (ctdb_db->delete_queue == NULL) {
+ DEBUG(DEBUG_ERR, (__location__ " Failed to re-create "
+ "the vacuum tree.\n"));
+ return -1;
+ }
+ }
+
return 0;
}