diff options
author | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-05-14 10:33:25 +1000 |
---|---|---|
committer | Ronnie Sahlberg <ronniesahlberg@gmail.com> | 2009-05-14 10:33:25 +1000 |
commit | 98a54c46754a385f7a146496b884124b2bedde94 (patch) | |
tree | 53cec6c8272f9c98c78ee8d9dbd4523c963a52be /ctdb/client | |
parent | 26b37d29b4049f8481f82c7a4d5fab20d4edb5a9 (diff) | |
download | samba-98a54c46754a385f7a146496b884124b2bedde94.tar.gz samba-98a54c46754a385f7a146496b884124b2bedde94.tar.xz samba-98a54c46754a385f7a146496b884124b2bedde94.zip |
Track how long it takes to take out the recovery lock from both the main dameon and also from the recovery daemon.
Log this in "ctdb statistics".
Also add a varaible "RecLockLatencyMs" that will log an error everytime it takes longer than this to access the reclock file.
(This used to be ctdb commit 042377ed803bb8f7ca9d6ea1a387427b7b8ba45a)
Diffstat (limited to 'ctdb/client')
-rw-r--r-- | ctdb/client/ctdb_client.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/ctdb/client/ctdb_client.c b/ctdb/client/ctdb_client.c index 3bdb4b2617..fa6a990a4d 100644 --- a/ctdb/client/ctdb_client.c +++ b/ctdb/client/ctdb_client.c @@ -3615,3 +3615,24 @@ int ctdb_ctrl_getscriptstatus(struct ctdb_context *ctdb, return 0; } +/* + tell the main daemon how long it took to lock the reclock file + */ +int ctdb_ctrl_report_recd_lock_latency(struct ctdb_context *ctdb, struct timeval timeout, double latency) +{ + int ret; + int32_t res; + TDB_DATA data; + + data.dptr = (uint8_t *)&latency; + data.dsize = sizeof(latency); + + ret = ctdb_control(ctdb, CTDB_CURRENT_NODE, 0, CTDB_CONTROL_RECD_RECLOCK_LATENCY, 0, data, + ctdb, NULL, &res, NULL, NULL); + if (ret != 0 || res != 0) { + DEBUG(DEBUG_ERR,("Failed to send recd reclock latency\n")); + return -1; + } + + return 0; +} |