summaryrefslogtreecommitdiffstats
path: root/ctdb/server/ctdb_control.c
diff options
context:
space:
mode:
authorAmitay Isaacs <amitay@gmail.com>2013-04-19 13:29:04 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-04-22 14:00:51 +1000
commit016522fe29ea6cbca989e87cde2e44793aa3e46b (patch)
treefa475e7c5edd859ebed25a22695ac2f3a94e638b /ctdb/server/ctdb_control.c
parent34718078751754f1463dafc13a92062635baea27 (diff)
downloadsamba-016522fe29ea6cbca989e87cde2e44793aa3e46b.tar.gz
samba-016522fe29ea6cbca989e87cde2e44793aa3e46b.tar.xz
samba-016522fe29ea6cbca989e87cde2e44793aa3e46b.zip
ctdbd: Set num_clients statistic from ctdb->num_clients
This fixes the problem of "ctdb statisticsreset" clearing the number of clients even when there are active clients. Values returned in statistics for frozen, recovering, memory_used are based on the current state of CTDB and are not maintained as statistics. This should include num_clients as well. Currently ctdb->num_clients is unused. So use that to track the number of clients and fill in statistics field only when requested. Signed-off-by: Amitay Isaacs <amitay@gmail.com> (This used to be ctdb commit dc4ca816630ed44b419108da53421331243fb8c7)
Diffstat (limited to 'ctdb/server/ctdb_control.c')
-rw-r--r--ctdb/server/ctdb_control.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ctdb/server/ctdb_control.c b/ctdb/server/ctdb_control.c
index 99b3dc43147..affb9dd00d3 100644
--- a/ctdb/server/ctdb_control.c
+++ b/ctdb/server/ctdb_control.c
@@ -100,6 +100,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
int i;
CHECK_CONTROL_DATA_SIZE(0);
ctdb->statistics.memory_used = talloc_total_size(NULL);
+ ctdb->statistics.num_clients = ctdb->num_clients;
ctdb->statistics.frozen = 0;
for (i=1; i<= NUM_DB_PRIORITIES; i++) {
if (ctdb->freeze_mode[i] == CTDB_FREEZE_FROZEN) {
@@ -204,7 +205,7 @@ static int32_t ctdb_control_dispatch(struct ctdb_context *ctdb,
case CTDB_CONTROL_PING:
CHECK_CONTROL_DATA_SIZE(0);
- return ctdb->statistics.num_clients;
+ return ctdb->num_clients;
case CTDB_CONTROL_SET_DB_READONLY: {
uint32_t db_id;