[SCM] CTDB repository - branch 1.2 updated - ctdb-1.0.114-342-gedc4298
Ronnie Sahlberg
sahlberg at samba.org
Wed Oct 6 23:24:39 MDT 2010
The branch, 1.2 has been updated
via edc4298859e6c00433ab09e0795a470199b15a37 (commit)
via d3b326c31cb455189a13957987825538af722def (commit)
via 70a3b56a53104c1bd5f26871cd29217accfe5e29 (commit)
from 57cbf7b3db9a71a1bafc5fc17b2b44bb0508f73e (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=1.2
- Log -----------------------------------------------------------------
commit edc4298859e6c00433ab09e0795a470199b15a37
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Thu Oct 7 16:18:27 2010 +1100
get rid of the "ctdb setflags" command since
1, we dont need it
2, it uses the ugly "modify flags" control that should die
commit d3b326c31cb455189a13957987825538af722def
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Thu Oct 7 14:39:07 2010 +1100
Dont log a normal vacuuming message about a missing record and using default vacuuming intervals as an error.
This is normal for a new system until the vacuuming has been initialized.
commit 70a3b56a53104c1bd5f26871cd29217accfe5e29
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Thu Sep 30 15:07:30 2010 +1000
when printing machinereadable statistics only print the header with the fieldnames once
-----------------------------------------------------------------------
Summary of changes:
server/ctdb_vacuum.c | 2 +-
tools/ctdb.c | 81 +++++++++++--------------------------------------
2 files changed, 19 insertions(+), 64 deletions(-)
Changeset truncated at 500 lines:
diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c
index dc26d08..b0c7d40 100644
--- a/server/ctdb_vacuum.c
+++ b/server/ctdb_vacuum.c
@@ -578,7 +578,7 @@ static int update_tuning_db(struct ctdb_db_context *ctdb_db, struct vacuum_data
}
tdata.last_interval = tdata.new_interval;
} else {
- DEBUG(DEBUG_ERR,(__location__ " Cannot find tunedb record for %s. Using default interval\n", ctdb_db->db_name));
+ DEBUG(DEBUG_DEBUG,(__location__ " Cannot find tunedb record for %s. Using default interval\n", ctdb_db->db_name));
tdata.last_num_repack = freelist;
tdata.last_num_empty = vdata->delete_count;
tdata.last_interval = ctdb_db->ctdb->tunable.vacuum_default_interval;
diff --git a/tools/ctdb.c b/tools/ctdb.c
index d1ec57d..77899f3 100644
--- a/tools/ctdb.c
+++ b/tools/ctdb.c
@@ -157,7 +157,7 @@ static int control_process_exists(struct ctdb_context *ctdb, int argc, const cha
/*
display statistics structure
*/
-static void show_statistics(struct ctdb_statistics *s)
+static void show_statistics(struct ctdb_statistics *s, int show_header)
{
TALLOC_CTX *tmp_ctx = talloc_new(NULL);
int i;
@@ -212,20 +212,21 @@ static void show_statistics(struct ctdb_statistics *s)
days = tmp;
if (options.machinereadable){
- printf("CTDB version:");
- printf("Current time of statistics:");
- printf("Statistics collected since:");
- for (i=0;i<ARRAY_SIZE(fields);i++) {
- printf("%s:", fields[i].name);
+ if (show_header) {
+ printf("CTDB version:");
+ printf("Current time of statistics:");
+ printf("Statistics collected since:");
+ for (i=0;i<ARRAY_SIZE(fields);i++) {
+ printf("%s:", fields[i].name);
+ }
+ printf("max_reclock_ctdbd:");
+ printf("max_reclock_recd:");
+ printf("max_call_latency:");
+ printf("max_lockwait_latency:");
+ printf("max_childwrite_latency:");
+ printf("max_childwrite_latency:");
+ printf("\n");
}
- printf("max_reclock_ctdbd:");
- printf("max_reclock_recd:");
- printf("max_call_latency:");
- printf("max_lockwait_latency:");
- printf("max_childwrite_latency:");
- printf("max_childwrite_latency:");
- printf("\n");
-
printf("%d:", CTDB_VERSION);
printf("%d:", (int)s->statistics_current_time.tv_sec);
printf("%d:", (int)s->statistics_start_time.tv_sec);
@@ -311,7 +312,7 @@ static int control_statistics_all(struct ctdb_context *ctdb)
}
talloc_free(nodes);
printf("Gathered statistics for %u nodes\n", num_nodes);
- show_statistics(&statistics);
+ show_statistics(&statistics, 1);
return 0;
}
@@ -332,7 +333,7 @@ static int control_statistics(struct ctdb_context *ctdb, int argc, const char **
DEBUG(DEBUG_ERR, ("Unable to get statistics from node %u\n", options.pnn));
return ret;
}
- show_statistics(&statistics);
+ show_statistics(&statistics, 1);
return 0;
}
@@ -375,11 +376,10 @@ static int control_stats(struct ctdb_context *ctdb, int argc, const char **argv)
if (stats->stats[i].statistics_start_time.tv_sec == 0) {
continue;
}
- show_statistics(&stats->stats[i]);
+ show_statistics(&stats->stats[i], i==0);
if (i == num_records) {
break;
}
- printf("===\n");
}
return 0;
}
@@ -4424,50 +4424,6 @@ static int control_wipedb(struct ctdb_context *ctdb, int argc,
}
/*
- * set flags of a node in the nodemap
- */
-static int control_setflags(struct ctdb_context *ctdb, int argc, const char **argv)
-{
- int ret;
- int32_t status;
- int node;
- int flags;
- TDB_DATA data;
- struct ctdb_node_flag_change c;
-
- if (argc != 2) {
- usage();
- return -1;
- }
-
- if (sscanf(argv[0], "%d", &node) != 1) {
- DEBUG(DEBUG_ERR, ("Badly formed node\n"));
- usage();
- return -1;
- }
- if (sscanf(argv[1], "0x%x", &flags) != 1) {
- DEBUG(DEBUG_ERR, ("Badly formed flags\n"));
- usage();
- return -1;
- }
-
- c.pnn = node;
- c.old_flags = 0;
- c.new_flags = flags;
-
- data.dsize = sizeof(c);
- data.dptr = (unsigned char *)&c;
-
- ret = ctdb_control(ctdb, options.pnn, 0, CTDB_CONTROL_MODIFY_FLAGS, 0,
- data, NULL, NULL, &status, NULL, NULL);
- if (ret != 0 || status != 0) {
- DEBUG(DEBUG_ERR,("Failed to modify flags\n"));
- return -1;
- }
- return 0;
-}
-
-/*
dump memory usage
*/
static int control_dumpmemory(struct ctdb_context *ctdb, int argc, const char **argv)
@@ -4765,7 +4721,6 @@ static const struct {
{ "dumpdbbackup", control_dumpdbbackup, false, true, "dump database backup from a file.", "<file>"},
{ "wipedb", control_wipedb, false, false, "wipe the contents of a database.", "<dbname>"},
{ "recmaster", control_recmaster, false, false, "show the pnn for the recovery master."},
- { "setflags", control_setflags, false, false, "set flags for a node in the nodemap.", "<node> <flags>"},
{ "scriptstatus", control_scriptstatus, false, false, "show the status of the monitoring scripts (or all scripts)", "[all]"},
{ "enablescript", control_enablescript, false, false, "enable an eventscript", "<script>"},
{ "disablescript", control_disablescript, false, false, "disable an eventscript", "<script>"},
--
CTDB repository
More information about the samba-cvs
mailing list