The branch, master has been updated via 8a86ac72088ad9f64ca83218c704f84c9abe00b6 (commit) via 71bf1260b1cac5ce83a92b4b944096b631ca87d8 (commit) via dbfd5abafbe66c20c413a4335b2cdbd9cc24052a (commit) via 94a5ce4e08e7891f07dbfe4c822ca4be5ab10965 (commit) from f6a47197dbb64cc7705fc564fa8dc78e958226c4 (commit)
http://gitweb.samba.org/?p=ctdb.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 8a86ac72088ad9f64ca83218c704f84c9abe00b6 Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Tue Sep 13 18:47:18 2011 +1000 ReadOnly: revokechild_active is a list, not a context. Dont reset the pointer to NULL after deleting the first entry, loop deleting one entry at a time until they are all gone or we will leak some memory and possibly a process. commit 71bf1260b1cac5ce83a92b4b944096b631ca87d8 Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Tue Sep 13 18:44:13 2011 +1000 Document 'cattdb' more clearly that it dumps the content of the local TDB and not the CTDB database commit dbfd5abafbe66c20c413a4335b2cdbd9cc24052a Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Tue Sep 13 18:41:34 2011 +1000 fix some compiler warnings for the test tools commit 94a5ce4e08e7891f07dbfe4c822ca4be5ab10965 Author: Ronnie Sahlberg <ronniesahlb...@gmail.com> Date: Tue Sep 13 18:38:20 2011 +1000 ReadOnly: Rename the function ctdb_ltdb_fetch_readonly() to ctdb_ltdb_fetch_with_header() since this is what it actually does. ----------------------------------------------------------------------- Summary of changes: client/ctdb_client.c | 4 ++-- common/ctdb_ltdb.c | 2 +- doc/ctdb.1.xml | 6 ++++++ include/ctdb_private.h | 2 +- server/ctdb_recover.c | 1 - tests/src/ctdb_fetch_readonly_loop.c | 6 +++--- tests/src/ctdb_fetch_readonly_once.c | 4 ++-- tools/ctdb.c | 4 ++-- 8 files changed, 17 insertions(+), 12 deletions(-) Changeset truncated at 500 lines: diff --git a/client/ctdb_client.c b/client/ctdb_client.c index 89eeb48..f2359ca 100644 --- a/client/ctdb_client.c +++ b/client/ctdb_client.c @@ -756,7 +756,7 @@ again: talloc_set_destructor(h, fetch_lock_destructor); /* Check if record exists yet in the TDB */ - ret = ctdb_ltdb_fetch_readonly(ctdb_db, key, &h->header, h, data); + ret = ctdb_ltdb_fetch_with_header(ctdb_db, key, &h->header, h, data); if (ret != 0) { ctdb_ltdb_unlock(ctdb_db, key); ret = ctdb_client_force_migration(ctdb_db, key); @@ -829,7 +829,7 @@ again: return NULL; } - ret = ctdb_ltdb_fetch_readonly(ctdb_db, key, &h->header, h, data); + ret = ctdb_ltdb_fetch_with_header(ctdb_db, key, &h->header, h, data); if (ret != 0) { ctdb_ltdb_unlock(ctdb_db, key); diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c index 76274ce..e4662ac 100644 --- a/common/ctdb_ltdb.c +++ b/common/ctdb_ltdb.c @@ -125,7 +125,7 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db, if the record does not exist, *header will be NULL and data = {0, NULL} */ -int ctdb_ltdb_fetch_readonly(struct ctdb_db_context *ctdb_db, +int ctdb_ltdb_fetch_with_header(struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_ltdb_header *header, TALLOC_CTX *mem_ctx, TDB_DATA *data) { diff --git a/doc/ctdb.1.xml b/doc/ctdb.1.xml index a88ecc7..a57c67f 100644 --- a/doc/ctdb.1.xml +++ b/doc/ctdb.1.xml @@ -1174,6 +1174,12 @@ HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/var/ctdb/persist </para> </refsect2> + <refsect2><title>cattdb <dbname></title> + <para> + This command will dump the content of the local TDB database to the screen. This is a debugging command. + </para> + </refsect2> + <refsect2><title>dumpdbbackup <backup-file></title> <para> This command will dump the content of database backup to the screen diff --git a/include/ctdb_private.h b/include/ctdb_private.h index b093bf0..7e59473 100644 --- a/include/ctdb_private.h +++ b/include/ctdb_private.h @@ -671,7 +671,7 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *ctdb_db, int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_ltdb_header *header, TDB_DATA data); int ctdb_ltdb_delete(struct ctdb_db_context *ctdb_db, TDB_DATA key); -int ctdb_ltdb_fetch_readonly(struct ctdb_db_context *ctdb_db, +int ctdb_ltdb_fetch_with_header(struct ctdb_db_context *ctdb_db, TDB_DATA key, struct ctdb_ltdb_header *header, TALLOC_CTX *mem_ctx, TDB_DATA *data); int32_t ctdb_control_start_persistent_update(struct ctdb_context *ctdb, diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c index 5d98c44..3d56f77 100644 --- a/server/ctdb_recover.c +++ b/server/ctdb_recover.c @@ -506,7 +506,6 @@ int32_t ctdb_control_push_db(struct ctdb_context *ctdb, TDB_DATA indata) } while (ctdb_db->revokechild_active != NULL) { talloc_free(ctdb_db->revokechild_active); - ctdb_db->revokechild_active = NULL; } } diff --git a/tests/src/ctdb_fetch_readonly_loop.c b/tests/src/ctdb_fetch_readonly_loop.c index 57194e2..1254018 100644 --- a/tests/src/ctdb_fetch_readonly_loop.c +++ b/tests/src/ctdb_fetch_readonly_loop.c @@ -27,7 +27,7 @@ static struct ctdb_db_context *ctdb_db; -char *TESTKEY = "testkey"; +const char *TESTKEY = "testkey"; static int count; /* @@ -53,7 +53,7 @@ static void fetch_lock_once(struct ctdb_context *ctdb, struct event_context *ev) } count++; - printf("%d data:%.*s\n", (int)count, data.dsize, data.dptr); + printf("%d data:%.*s\n", (int)count, (int)data.dsize, data.dptr); talloc_free(tmp_ctx); } @@ -99,7 +99,7 @@ int main(int argc, const char *argv[]) ctdb = ctdb_cmdline_client(ev, timeval_current_ofs(5, 0)); - key.dptr = TESTKEY; + key.dptr = discard_const(TESTKEY); key.dsize = strlen(TESTKEY); ret = ctdb_ctrl_getvnnmap(ctdb, timeval_zero(), CTDB_CURRENT_NODE, ctdb, &ctdb->vnn_map); diff --git a/tests/src/ctdb_fetch_readonly_once.c b/tests/src/ctdb_fetch_readonly_once.c index 9dfd97d..40d071f 100644 --- a/tests/src/ctdb_fetch_readonly_once.c +++ b/tests/src/ctdb_fetch_readonly_once.c @@ -27,7 +27,7 @@ static struct ctdb_db_context *ctdb_db; -char *TESTKEY = "testkey"; +const char *TESTKEY = "testkey"; /* @@ -102,7 +102,7 @@ int main(int argc, const char *argv[]) ctdb = ctdb_cmdline_client(ev, timeval_current_ofs(5, 0)); - key.dptr = TESTKEY; + key.dptr = discard_const(TESTKEY); key.dsize = strlen(TESTKEY); ret = ctdb_ctrl_getvnnmap(ctdb, timeval_zero(), CTDB_CURRENT_NODE, ctdb, &ctdb->vnn_map); diff --git a/tools/ctdb.c b/tools/ctdb.c index 9443eca..fc281e4 100644 --- a/tools/ctdb.c +++ b/tools/ctdb.c @@ -5020,8 +5020,8 @@ static const struct { { "process-exists", control_process_exists, true, false, "check if a process exists on a node", "<pid>"}, { "getdbmap", control_getdbmap, true, false, "show the database map" }, { "getdbstatus", control_getdbstatus, true, false, "show the status of a database", "<dbname>" }, - { "catdb", control_catdb, true, false, "dump a database" , "<dbname>"}, - { "cattdb", control_cattdb, true, false, "dump a database" , "<dbname>"}, + { "catdb", control_catdb, true, false, "dump a ctdb database" , "<dbname>"}, + { "cattdb", control_cattdb, true, false, "dump a local tdb database" , "<dbname>"}, { "getmonmode", control_getmonmode, true, false, "show monitoring mode" }, { "getcapabilities", control_getcapabilities, true, false, "show node capabilities" }, { "pnn", control_pnn, true, false, "show the pnn of the currnet node" }, -- CTDB repository