When attaching to a non-persistent DB, initialize the delete_queue.
authorMichael Adam <obnox@samba.org>
Fri, 17 Dec 2010 00:38:09 +0000 (01:38 +0100)
committerMichael Adam <obnox@samba.org>
Wed, 9 Mar 2011 23:37:00 +0000 (00:37 +0100)
server/ctdb_ltdb_server.c

index ad9b30f8403a318bb17d321882c181ba88daf442..31a5f4f31e695fbed1f9f89bb0c2c324e41a1393 100644 (file)
@@ -25,6 +25,7 @@
 #include "system/dir.h"
 #include "system/time.h"
 #include "../include/ctdb_private.h"
+#include "../common/rb_tree.h"
 #include "db_wrap.h"
 #include "lib/util/dlinklist.h"
 #include <ctype.h>
@@ -536,6 +537,13 @@ static int ctdb_local_attach(struct ctdb_context *ctdb, const char *db_name,
        ctdb_db->db_id = ctdb_hash(&key);
        ctdb_db->persistent = persistent;
 
+       if (!ctdb_db->persistent) {
+               ctdb_db->delete_queue = trbt_create(ctdb_db, 0);
+               if (ctdb_db->delete_queue == NULL) {
+                       CTDB_NO_MEMORY(ctdb, ctdb_db->delete_queue);
+               }
+       }
+
        /* check for hash collisions */
        for (tmp_db=ctdb->db_list;tmp_db;tmp_db=tmp_db->next) {
                if (tmp_db->db_id == ctdb_db->db_id) {