[SCM] CTDB repository - branch master updated - ctdb-1.10-424-g750a31c
Ronnie Sahlberg
sahlberg at samba.org
Tue Aug 23 00:53:18 MDT 2011
The branch, master has been updated
via 750a31cf95c356a0ee071967537eb615dce35845 (commit)
via 81c14c8625a6d5670b8795a655d7a3f3318009e5 (commit)
from 2cc48be3219b887b85649a14db311af0549041cf (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 750a31cf95c356a0ee071967537eb615dce35845
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Aug 23 16:35:08 2011 +1000
LibCTDB : update the ctdb tool to use libctdb to read the recovery mode
commit 81c14c8625a6d5670b8795a655d7a3f3318009e5
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Aug 23 16:32:38 2011 +1000
LibCTDB : uptade the ctdb tool to use libctdb to query for the recmaster
-----------------------------------------------------------------------
Summary of changes:
tools/ctdb.c | 31 +++++++++++--------------------
1 files changed, 11 insertions(+), 20 deletions(-)
Changeset truncated at 500 lines:
diff --git a/tools/ctdb.c b/tools/ctdb.c
index d760f6b..f435a21 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -737,17 +737,15 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
printf("hash:%d lmaster:%d\n", i, vnnmap->map[i]);
}
- ret = ctdb_ctrl_getrecmode(ctdb, ctdb, TIMELIMIT(), options.pnn, &recmode);
- if (ret != 0) {
+ if (!ctdb_getrecmode(ctdb_connection, options.pnn, &recmode)) {
DEBUG(DEBUG_ERR, ("Unable to get recmode from node %u\n", options.pnn));
- return ret;
+ return -1;
}
printf("Recovery mode:%s (%d)\n",recmode==CTDB_RECOVERY_NORMAL?"NORMAL":"RECOVERY",recmode);
- ret = ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), options.pnn, &recmaster);
- if (ret != 0) {
+ if (!ctdb_getrecmaster(ctdb_connection, options.pnn, &recmaster)) {
DEBUG(DEBUG_ERR, ("Unable to get recmaster from node %u\n", options.pnn));
- return ret;
+ return -1;
}
printf("Recovery master:%d\n",recmaster);
@@ -1095,13 +1093,11 @@ static int control_disablescript(struct ctdb_context *ctdb, int argc, const char
*/
static int control_recmaster(struct ctdb_context *ctdb, int argc, const char **argv)
{
- int ret;
uint32_t recmaster;
- ret = ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), options.pnn, &recmaster);
- if (ret != 0) {
+ if (!ctdb_getrecmaster(ctdb_connection, options.pnn, &recmaster)) {
DEBUG(DEBUG_ERR, ("Unable to get recmaster from node %u\n", options.pnn));
- return ret;
+ return -1;
}
printf("%d\n",recmaster);
@@ -1596,10 +1592,9 @@ again:
}
- ret = ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), options.pnn, &recmaster);
- if (ret != 0) {
+ if (!ctdb_getrecmaster(ctdb_connection, options.pnn, &recmaster)) {
DEBUG(DEBUG_ERR, ("Unable to get recmaster from node %u\n", options.pnn));
- return ret;
+ return -1;
}
/* verify the node exists */
@@ -2543,15 +2538,13 @@ static uint32_t get_generation(struct ctdb_context *ctdb)
}
/* get the recmaster */
- ret = ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), CTDB_CURRENT_NODE, &recmaster);
- if (ret != 0) {
+ if (!ctdb_getrecmaster(ctdb_connection, CTDB_CURRENT_NODE, &recmaster)) {
DEBUG(DEBUG_ERR, ("Unable to get recmaster from node %u\n", options.pnn));
exit(10);
}
/* get recovery mode */
- ret = ctdb_ctrl_getrecmode(ctdb, ctdb, TIMELIMIT(), recmaster, &recmode);
- if (ret != 0) {
+ if (!ctdb_getrecmode(ctdb_connection, recmaster, &recmode)) {
DEBUG(DEBUG_ERR, ("Unable to get recmode from node %u\n", options.pnn));
exit(10);
}
@@ -3593,7 +3586,6 @@ static int control_getdbstatus(struct ctdb_context *ctdb, int argc, const char *
static int control_isnotrecmaster(struct ctdb_context *ctdb, int argc, const char **argv)
{
uint32_t mypnn, recmaster;
- int ret;
mypnn = ctdb_ctrl_getpnn(ctdb, TIMELIMIT(), options.pnn);
if (mypnn == -1) {
@@ -3601,8 +3593,7 @@ static int control_isnotrecmaster(struct ctdb_context *ctdb, int argc, const cha
return 1;
}
- ret = ctdb_ctrl_getrecmaster(ctdb, ctdb, TIMELIMIT(), options.pnn, &recmaster);
- if (ret != 0) {
+ if (!ctdb_getrecmaster(ctdb_connection, options.pnn, &recmaster)) {
printf("Failed to get the recmaster\n");
return 1;
}
--
CTDB repository
More information about the samba-cvs
mailing list