From Volker L
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 13 Oct 2009 09:57:03 +0000 (20:57 +1100)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 13 Oct 2009 09:57:03 +0000 (20:57 +1100)
A less intrusive deadlock prevention workaround

server/ctdb_freeze.c
server/ctdb_recover.c

index 6f99f8beb401da008624d4fbb384a416a4d95a81..78493cb99a01be665041b4ccd12f85e1288e125c 100644 (file)
@@ -34,6 +34,17 @@ static int ctdb_lock_all_databases(struct ctdb_context *ctdb)
 {
        struct ctdb_db_context *ctdb_db;
        for (ctdb_db=ctdb->db_list;ctdb_db;ctdb_db=ctdb_db->next) {
+               if (strstr(ctdb_db->db_name, "notify") != NULL) {
+                       continue;
+               }
+               if (tdb_lockall(ctdb_db->ltdb->tdb) != 0) {
+                       return -1;
+               }
+       }
+       for (ctdb_db=ctdb->db_list;ctdb_db;ctdb_db=ctdb_db->next) {
+               if (strstr(ctdb_db->db_name, "notify") == NULL) {
+                       continue;
+               }
                if (tdb_lockall(ctdb_db->ltdb->tdb) != 0) {
                        return -1;
                }
index b4428fa4946e9edaf6974a3081fe5ef973742fdb..0fe2094f8a7a8854f119744bc0f3f505cbecb9ad 100644 (file)
@@ -39,6 +39,17 @@ static int ctdb_lock_all_databases_mark(struct ctdb_context *ctdb)
                return -1;
        }
        for (ctdb_db=ctdb->db_list;ctdb_db;ctdb_db=ctdb_db->next) {
+               if (strstr(ctdb_db->db_name, "notify") != NULL) {
+                       continue;
+               }
+               if (tdb_lockall_mark(ctdb_db->ltdb->tdb) != 0) {
+                       return -1;
+               }
+       }
+       for (ctdb_db=ctdb->db_list;ctdb_db;ctdb_db=ctdb_db->next) {
+               if (strstr(ctdb_db->db_name, "notify") == NULL) {
+                       continue;
+               }
                if (tdb_lockall_mark(ctdb_db->ltdb->tdb) != 0) {
                        return -1;
                }