[SCM] CTDB repository - branch master updated - ctdb-1.0.114-327-g25f96db
Ronnie Sahlberg
sahlberg at samba.org
Wed Oct 6 23:24:39 MDT 2010
The branch, master has been updated
via 25f96db966230e90291eee57841c9faaae33713b (commit)
via ffd5fdd23b1cb07078759a78cd1d884f92aa4851 (commit)
via 70c8d429d7c13cbbd08184ff8f0aa506de5adccc (commit)
from 3a033156c48d821d48fd18f12c3b0ac14bbddc93 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 25f96db966230e90291eee57841c9faaae33713b
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 ffd5fdd23b1cb07078759a78cd1d884f92aa4851
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 70c8d429d7c13cbbd08184ff8f0aa506de5adccc
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 371567a..8d42255 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;
}
@@ -4462,50 +4462,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)
@@ -4803,7 +4759,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