From: Andrew Tridgell Date: Sat, 28 Apr 2007 15:13:30 +0000 (+0200) Subject: added status all and debug all control operations X-Git-Tag: tevent-0.9.20~348^2~2816 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4b6d00974d0c27ce8c7a399b21bfa6dcf9db7d0c;p=thirdparty%2Fsamba.git added status all and debug all control operations (This used to be ctdb commit 7f902f6c4270adc0543096c78415d335b88d6232) --- diff --git a/ctdb/common/ctdb_call.c b/ctdb/common/ctdb_call.c index 18172996ca2..cfbea14863d 100644 --- a/ctdb/common/ctdb_call.c +++ b/ctdb/common/ctdb_call.c @@ -729,12 +729,14 @@ struct ctdb_call_state *ctdb_daemon_call_send_remote(struct ctdb_db_context *ctd struct ctdb_req_call); CTDB_NO_MEMORY_NULL(ctdb, state->c); state->c->hdr.destnode = header->dmaster; - /* - always sending the remote call straight to the lmaster + +#if 0 + /*always sending the remote call straight to the lmaster improved performance slightly in some tests. worth investigating further in the future - state->c->hdr.destnode = ctdb_lmaster(ctdb_db->ctdb, &(call->key)); */ + state->c->hdr.destnode = ctdb_lmaster(ctdb_db->ctdb, &(call->key)); +#endif /* this limits us to 16k outstanding messages - not unreasonable */ diff --git a/ctdb/include/ctdb_private.h b/ctdb/include/ctdb_private.h index fa8d3debf46..e2cc6bfe697 100644 --- a/ctdb/include/ctdb_private.h +++ b/ctdb/include/ctdb_private.h @@ -157,6 +157,7 @@ struct ctdb_status { uint32_t pending_calls; uint32_t lockwait_calls; uint32_t pending_lockwait_calls; + uint32_t __last_uint32; /* hack for control_status_all */ uint32_t max_redirect_count; double max_call_latency; double max_lockwait_latency; diff --git a/ctdb/tools/ctdb_control.c b/ctdb/tools/ctdb_control.c index 41f6c4c774f..7809f1406fb 100644 --- a/ctdb/tools/ctdb_control.c +++ b/ctdb/tools/ctdb_control.c @@ -35,8 +35,8 @@ static void usage(void) printf("\nControls:\n"); printf(" ping\n"); printf(" process-exists see if a process exists\n"); - printf(" status show ctdb status on a node\n"); - printf(" debug set ctdb debug level on a node\n"); + printf(" status show ctdb status on a node\n"); + printf(" debug set ctdb debug level on a node\n"); printf(" debuglevel display ctdb debug levels\n"); printf(" getvnnmap display ctdb vnnmap\n"); printf(" setvnnmap *\n"); @@ -105,6 +105,41 @@ static void show_status(struct ctdb_status *s) printf(" max_lockwait_latency %.6f sec\n", s->max_lockwait_latency); } +/* + display remote ctdb status combined from all nodes + */ +static int control_status_all(struct ctdb_context *ctdb) +{ + int ret, i; + struct ctdb_status status; + ZERO_STRUCT(status); + + for (i=0;inum_nodes;i++) { + struct ctdb_status s1; + int j; + uint32_t *v1 = (uint32_t *)&s1; + uint32_t *v2 = (uint32_t *)&status; + uint32_t num_ints = + offsetof(struct ctdb_status, __last_uint32) / sizeof(uint32_t); + ret = ctdb_status(ctdb, i, &s1); + if (ret != 0) { + printf("Unable to get status from node %u\n", i); + return ret; + } + for (j=0;jnum_nodes;i++) { + ret = ctdb_set_debuglevel(ctdb, i, level); + if (ret != 0) { + printf("Unable to set debug level on node %u\n", i); + break; + } + } + return 0; + } + + vnn = strtoul(argv[0], NULL, 0); ret = ctdb_set_debuglevel(ctdb, vnn, level); if (ret != 0) { printf("Unable to set debug level on node %u\n", vnn); } + return 0; }