summaryrefslogtreecommitdiffstats
path: root/ctdb/include
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-06-07 15:18:55 +1000
committerAndrew Tridgell <tridge@samba.org>2007-06-07 15:18:55 +1000
commit2ed57a9ae1fa09c247c308e3878abd80bc23c42e (patch)
tree96dc9294f6e053009f3a5d7c4abe5d5372431ab4 /ctdb/include
parent9754d16d4806463c53cc3233640c828982aa0b2c (diff)
parente0fbd04697d05edd32e419993a0f0e4a19633626 (diff)
downloadsamba-2ed57a9ae1fa09c247c308e3878abd80bc23c42e.tar.gz
samba-2ed57a9ae1fa09c247c308e3878abd80bc23c42e.tar.xz
samba-2ed57a9ae1fa09c247c308e3878abd80bc23c42e.zip
implement a scheme where nodes are banned if they continuously caused the cluster
to start a recovery session. The node is banned from the cluster for the RecoveryBanPeriod (default of 5 minutes) (This used to be ctdb commit 4ad43dd07f526b6002477177fbf55483246c2c0c)
Diffstat (limited to 'ctdb/include')
-rw-r--r--ctdb/include/ctdb.h8
-rw-r--r--ctdb/include/ctdb_private.h22
2 files changed, 21 insertions, 9 deletions
diff --git a/ctdb/include/ctdb.h b/ctdb/include/ctdb.h
index 4e8fe4fa3c..545120b174 100644
--- a/ctdb/include/ctdb.h
+++ b/ctdb/include/ctdb.h
@@ -351,9 +351,9 @@ int ctdb_ctrl_list_tunables(struct ctdb_context *ctdb,
TALLOC_CTX *mem_ctx,
const char ***list, uint32_t *count);
-int ctdb_ctrl_permdisable(struct ctdb_context *ctdb,
- struct timeval timeout,
- uint32_t destnode,
- uint32_t mode);
+int ctdb_ctrl_modflags(struct ctdb_context *ctdb,
+ struct timeval timeout,
+ uint32_t destnode,
+ uint32_t set, uint32_t clear);
#endif
diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h
index 2ec3081762..aced667b15 100644
--- a/ctdb/include/ctdb_private.h
+++ b/ctdb/include/ctdb_private.h
@@ -53,6 +53,8 @@ struct ctdb_tunable {
uint32_t takeover_timeout;
uint32_t monitor_interval;
uint32_t script_timeout;
+ uint32_t recovery_grace_period;
+ uint32_t recovery_ban_period;
};
/*
@@ -111,10 +113,12 @@ struct ctdb_node {
const char *name; /* for debug messages */
void *private_data; /* private to transport */
uint32_t vnn;
-#define NODE_FLAGS_CONNECTED 0x00000001
-#define NODE_FLAGS_UNHEALTHY 0x00000002
-#define NODE_FLAGS_PERMANENTLY_DISABLED 0x00000004
+#define NODE_FLAGS_DISCONNECTED 0x00000001 /* node isn't connected */
+#define NODE_FLAGS_UNHEALTHY 0x00000002 /* monitoring says node is unhealthy */
+#define NODE_FLAGS_PERMANENTLY_DISABLED 0x00000004 /* administrator has disabled node */
+#define NODE_FLAGS_BANNED 0x00000008 /* recovery daemon has banned the node */
#define NODE_FLAGS_DISABLED (NODE_FLAGS_UNHEALTHY|NODE_FLAGS_PERMANENTLY_DISABLED)
+#define NODE_FLAGS_INACTIVE (NODE_FLAGS_DISCONNECTED|NODE_FLAGS_BANNED)
uint32_t flags;
/* used by the dead node monitoring */
@@ -414,7 +418,7 @@ enum ctdb_controls {CTDB_CONTROL_PROCESS_EXISTS = 0,
CTDB_CONTROL_GET_TUNABLE = 49,
CTDB_CONTROL_LIST_TUNABLES = 50,
CTDB_CONTROL_GET_PUBLIC_IPS = 51,
- CTDB_CONTROL_PERMANENTLY_DISABLE = 52,
+ CTDB_CONTROL_MODIFY_FLAGS = 52,
};
/*
@@ -467,6 +471,14 @@ struct ctdb_node_flag_change {
uint32_t flags;
};
+/*
+ structure to change flags on a node
+ */
+struct ctdb_node_modflags {
+ uint32_t set;
+ uint32_t clear;
+};
+
enum call_state {CTDB_CALL_WAIT, CTDB_CALL_DONE, CTDB_CALL_ERROR};
#define CTDB_LMASTER_ANY 0xffffffff
@@ -1010,6 +1022,6 @@ int32_t ctdb_control_list_tunables(struct ctdb_context *ctdb, TDB_DATA *outdata)
void ctdb_tunables_set_defaults(struct ctdb_context *ctdb);
-int32_t ctdb_control_permdisable(struct ctdb_context *ctdb, TDB_DATA indata);
+int32_t ctdb_control_modflags(struct ctdb_context *ctdb, TDB_DATA indata);
#endif