diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2008-09-09 13:44:46 +1000 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2008-09-09 13:44:46 +1000 |
commit | 6474f3278d33107bee8fb499d71c2a682c8c3403 (patch) | |
tree | ae73a84ca8a0e75ab54ecf7c79202b6e14f191a6 /ctdb/client | |
parent | 7a78a78a1c0de5ef3f470326eee2c1ca7e57e607 (diff) | |
download | samba-6474f3278d33107bee8fb499d71c2a682c8c3403.tar.gz samba-6474f3278d33107bee8fb499d71c2a682c8c3403.tar.xz samba-6474f3278d33107bee8fb499d71c2a682c8c3403.zip |
additional monitoring between the two daemons.
we currently only monitor that the dameons are running by kill(0, pid)
and verifying the the domain socket between them is ok.
this is not sufficient since we can have a situation where the recovery
daemon is hung.
this new code monitors that the recovery daemon is operating.
if the recovery hangs, we log this and shut down the main daemon
(This used to be ctdb commit cd69d292292eaab3aac0e9d9fc57cb621597c63c)
Diffstat (limited to 'ctdb/client')
-rw-r--r-- | ctdb/client/ctdb_client.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index dfcd4d90e7..6d80efc205 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -3280,3 +3280,21 @@ again: talloc_free(h); return 0; } + +/* + recovery daemon ping to main daemon + */ +int ctdb_ctrl_recd_ping(struct ctdb_context *ctdb) +{ + int ret; + int32_t res; + + ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0, CTDB_CONTROL_RECD_PING, 0, tdb_null, + ctdb, NULL, &res, NULL, NULL); + if (ret != 0 || res != 0) { + DEBUG(DEBUG_ERR,("Failed to send recd ping\n")); + return -1; + } + + return 0; +} |