git.samba.org
/
metze
/
ctdb
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4505ea1
)
if all nodes are STOPPED, pick one of the STOPPED nodes as natgw master
author
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Thu, 16 Jul 2009 23:36:22 +0000
(09:36 +1000)
committer
Ronnie Sahlberg
<ronniesahlberg@gmail.com>
Thu, 16 Jul 2009 23:36:22 +0000
(09:36 +1000)
tools/ctdb.c
patch
|
blob
|
history
diff --git
a/tools/ctdb.c
b/tools/ctdb.c
index 352c74f4ad3081a7e1560cf0b5b7ef8aadf6e025..d1ff7593514fb76606c1cef5ec09144e65e2f820 100644
(file)
--- a/
tools/ctdb.c
+++ b/
tools/ctdb.c
@@
-686,6
+686,19
@@
static int control_natgwlist(struct ctdb_context *ctdb, int argc, const char **a
break;
}
}
+ /* unless all nodes are STOPPED, when we pick one anyway */
+ if (i == nodemap->num) {
+ for(i=0;i<nodemap->num;i++){
+ if (!(nodemap->nodes[i].flags & (NODE_FLAGS_DISCONNECTED|NODE_FLAGS_DELETED))) {
+ printf("%d\n", nodemap->nodes[i].pnn);
+ break;
+ }
+ }
+ /* or if we still can not find any */
+ if (i == nodemap->num) {
+ printf("-1\n");
+ }
+ }
/* print the pruned list of nodes belonging to this natgw list */
for(i=0;i<nodemap->num;i++){