[Sheepdog] [PATCH v3 3/7] sheep: transient failure - collie tool changes

yaohaiting.wujue at gmail.com yaohaiting.wujue at gmail.com
Wed May 2 09:12:51 CEST 2012


From: HaiTing Yao <wujue.yht at taobao.com>

collie tool will show the status of node failed/normal

Signed-off-by: HaiTing Yao <wujue.yht at taobao.com>
---
 collie/node.c |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/collie/node.c b/collie/node.c
index 0dda384..cfd7055 100644
--- a/collie/node.c
+++ b/collie/node.c
@@ -26,7 +26,8 @@ static int node_list(int argc, char **argv)
 	int i;
 
 	if (!raw_output)
-		printf("M   Id   Host:Port         V-Nodes       Zone\n");
+		printf("M   Id   Host:Port         V-Nodes       "\
+			"Zone        Status\n");
 	for (i = 0; i < nr_nodes; i++) {
 		char data[128];
 
@@ -36,15 +37,21 @@ static int node_list(int argc, char **argv)
 		if (i == master_idx) {
 			if (highlight)
 				printf(TEXT_BOLD);
-			printf(raw_output ? "* %d %s %d %d\n" : "* %4d   %-20s\t%2d%11d\n",
+			printf(raw_output ? "* %d %s %d %d\n" :
+				"* %4d   %-20s\t%2d%11d        %s\n",
 			       i, data, node_list_entries[i].nr_vnodes,
-			       node_list_entries[i].zone);
+			       node_list_entries[i].zone,
+				node_list_entries[i].status ?
+				"failed" : "normal");
 			if (highlight)
 				printf(TEXT_NORMAL);
 		} else
-			printf(raw_output ? "- %d %s %d %d\n" : "- %4d   %-20s\t%2d%11d\n",
+			printf(raw_output ? "- %d %s %d %d\n" :
+				"- %4d   %-20s\t%2d%11d        %s\n",
 			       i, data, node_list_entries[i].nr_vnodes,
-			       node_list_entries[i].zone);
+			       node_list_entries[i].zone,
+				node_list_entries[i].status ?
+				"failed" : "normal");
 	}
 
 	return EXIT_SUCCESS;
-- 
1.7.1




More information about the sheepdog mailing list