summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_persistent.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-12-07 13:28:11 +0100
committerStefan Metzmacher <metze@samba.org>2009-12-16 08:06:10 +0100
commit94bc40307ac62d552af478ef3b05630a4a54d8cc (patch)
treea7ab8f3e727e300ce576d5a3b593d29467d6dcaf /ctdb/server/ctdb_persistent.c
parent9069d3a7fb013a87c1b4e4c0a83651d3921e9955 (diff)
downloadsamba-94bc40307ac62d552af478ef3b05630a4a54d8cc.tar.gz
samba-94bc40307ac62d552af478ef3b05630a4a54d8cc.tar.xz
samba-94bc40307ac62d552af478ef3b05630a4a54d8cc.zip
server: Use tdb_check to verify persistent tdbs on startup
Depending on --max-persistent-check-errors we allow ctdb to start with unhealthy persistent databases. The default is 0 which means to reject a startup with unhealthy dbs. The health of the persistent databases is checked after each recovery. Node monitoring and the "startup" is deferred until all persistent databases are healthy. Databases can become healthy automaticly by a completely HEALTHY node joining the cluster. Or by an administrator with "ctdb backupdb/restoredb" or "ctdb wipedb". metze (This used to be ctdb commit 15f133d5150ed1badb4fef7d644f10cd08a25cb5)
Diffstat (limited to 'ctdb/server/ctdb_persistent.c')
-rw-r--r--ctdb/server/ctdb_persistent.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index 59ddadb042..b686cbdee8 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -117,6 +117,12 @@ int32_t ctdb_control_trans2_commit(struct ctdb_context *ctdb,
return -1;
}
+ if (ctdb_db->unhealthy_reason) {
+ DEBUG(DEBUG_ERR,("db(%s) unhealty in ctdb_control_trans2_commit: %s\n",
+ ctdb_db->db_name, ctdb_db->unhealthy_reason));
+ return -1;
+ }
+
/* handling num_persistent_updates is a bit strange -
there are 3 cases
1) very old clients, which never called CTDB_CONTROL_START_PERSISTENT_UPDATE
@@ -597,6 +603,12 @@ int32_t ctdb_control_update_record(struct ctdb_context *ctdb,
return -1;
}
+ if (ctdb_db->unhealthy_reason) {
+ DEBUG(DEBUG_ERR,("db(%s) unhealty in ctdb_control_update_record: %s\n",
+ ctdb_db->db_name, ctdb_db->unhealthy_reason));
+ return -1;
+ }
+
state = talloc(ctdb, struct ctdb_persistent_write_state);
CTDB_NO_MEMORY(ctdb, state);