From 27f07d17ad5e11366759face684996e84306777d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 19 Sep 2006 11:15:50 +0800 Subject: [PATCH 1/3] BUG#21585 The --help option shows a screen of command options for the ndbd,ndb_mgmd, ndb_mgm and other commands related to ndb. For all of these, the help screen contains "Ndb.cfg" string. Now i change the "Ndb.cfg" to "my.cnf" because "Ndb.cfg" is obsolete. ndb/include/util/ndb_opts.h: Change help info from Ndb.cfg to my.cnf in the header file. ndb/test/ndbapi/flexScan.cpp: Change help info from Ndb.cfg to my.cnf. ndb/tools/ndb_config.cpp: Change help info from Ndb.cfg to my.cnf --- ndb/include/util/ndb_opts.h | 2 +- ndb/test/ndbapi/flexScan.cpp | 4 ++-- ndb/tools/ndb_config.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index 462d9996582..ac2a48d6fe9 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -49,7 +49,7 @@ my_bool opt_core; { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ "Set connect string for connecting to ndb_mgmd. " \ "Syntax: \"[nodeid=;][host=][:]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ + "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \ (gptr*) &opt_connect_str, (gptr*) &opt_connect_str, 0, \ GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ { "ndb-shm", OPT_NDB_SHM,\ diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp index 4d2c85d6955..1f001bd0210 100644 --- a/ndb/test/ndbapi/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan.cpp @@ -27,7 +27,7 @@ verify delete Arguments: - -f Location of Ndb.cfg file, default Ndb.cfg + -f Location of my.cnf file, default my.cnf -t Number of threads to start, default 1 -o Number of operations per loop, default 500 -l Number of loops to run, default 1, 0=infinite -a Number of attributes, default 25 @@ -829,7 +829,7 @@ static int createTables(Ndb* pMyNdb) static void printUsage() { ndbout << "Usage of flexScan:" << endl; - ndbout << "-f Location of Ndb.cfg file, default: Ndb.cfg" << endl; + ndbout << "-f Location of my.cnf file, default: my.cnf" << endl; ndbout << "-t Number of threads to start, default 1" << endl; ndbout << "-o Number of operations per loop, default 500" << endl; ndbout << "-l Number of loops to run, default 1, 0=infinite" << endl; diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 78a2fa38fba..0eaabf76eae 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -64,7 +64,7 @@ static struct my_option my_long_options[] = { "ndb-connectstring", 256, "Set connect string for connecting to ndb_mgmd. " "Syntax: \"[nodeid=;][host=][:]\". " - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", + "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", (gptr*) &g_connectstring, (gptr*) &g_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "nodes", 256, "Print nodes", From 6cdf3c65a4d0c2e48de0693f40233eb3e70a8b4c Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 22 Sep 2006 20:13:03 +0800 Subject: [PATCH 2/3] BUG#21585 The --help option shows a screen of command options for ndbd, ndb_mgmd, ndb_mgm and other commands related to ndb. For all of these, the help screen contains "Ndb.cfg" string. Now i change the "Ndb.cfg" to "my.cnf" because "Ndb.cfg" is obsolete. ndb/include/util/ndb_opts.h: Change help info from "Ndb.cfg" string to "my.cnf" string in the header file. ndb/test/ndbapi/flexScan.cpp: Change help info from including "Ndb.cfg" to "my.cnf". ndb/tools/ndb_config.cpp: Change help info from including "Ndb.cfg" to "my.cnf". --- ndb/include/util/ndb_opts.h | 2 +- ndb/test/ndbapi/flexScan.cpp | 4 ++-- ndb/tools/ndb_config.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ndb/include/util/ndb_opts.h b/ndb/include/util/ndb_opts.h index 08ab4a2e9df..053cc8613f7 100644 --- a/ndb/include/util/ndb_opts.h +++ b/ndb/include/util/ndb_opts.h @@ -58,7 +58,7 @@ const char *opt_debug= 0; { "ndb-connectstring", OPT_NDB_CONNECTSTRING, \ "Set connect string for connecting to ndb_mgmd. " \ "Syntax: \"[nodeid=;][host=][:]\". " \ - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", \ + "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", \ (gptr*) &opt_ndb_connectstring, (gptr*) &opt_ndb_connectstring, \ 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },\ { "ndb-mgmd-host", OPT_NDB_MGMD, \ diff --git a/ndb/test/ndbapi/flexScan.cpp b/ndb/test/ndbapi/flexScan.cpp index 4d2c85d6955..1f001bd0210 100644 --- a/ndb/test/ndbapi/flexScan.cpp +++ b/ndb/test/ndbapi/flexScan.cpp @@ -27,7 +27,7 @@ verify delete Arguments: - -f Location of Ndb.cfg file, default Ndb.cfg + -f Location of my.cnf file, default my.cnf -t Number of threads to start, default 1 -o Number of operations per loop, default 500 -l Number of loops to run, default 1, 0=infinite -a Number of attributes, default 25 @@ -829,7 +829,7 @@ static int createTables(Ndb* pMyNdb) static void printUsage() { ndbout << "Usage of flexScan:" << endl; - ndbout << "-f Location of Ndb.cfg file, default: Ndb.cfg" << endl; + ndbout << "-f Location of my.cnf file, default: my.cnf" << endl; ndbout << "-t Number of threads to start, default 1" << endl; ndbout << "-o Number of operations per loop, default 500" << endl; ndbout << "-l Number of loops to run, default 1, 0=infinite" << endl; diff --git a/ndb/tools/ndb_config.cpp b/ndb/tools/ndb_config.cpp index 27ab6a182bb..b59c1731659 100644 --- a/ndb/tools/ndb_config.cpp +++ b/ndb/tools/ndb_config.cpp @@ -67,7 +67,7 @@ static struct my_option my_long_options[] = { "ndb-connectstring", 256, "Set connect string for connecting to ndb_mgmd. " "Syntax: \"[nodeid=;][host=][:]\". " - "Overides specifying entries in NDB_CONNECTSTRING and Ndb.cfg", + "Overrides specifying entries in NDB_CONNECTSTRING and my.cnf", (gptr*) &g_connectstring, (gptr*) &g_connectstring, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 }, { "ndb-shm", 256, "Print nodes", From d743ce1ef163d340fdec38a0642790eb98484353 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 26 Sep 2006 11:03:11 +0800 Subject: [PATCH 3/3] fix for bug#19651, if temporary error occured while retoring, report it in the restore result. ndb/tools/restore/consumer.hpp: added a function to judge whether there is temporary error. ndb/tools/restore/consumer_restore.cpp: record when temporary error occured in restore. ndb/tools/restore/consumer_restore.hpp: added a member to record temporary error in restore. ndb/tools/restore/restore_main.cpp: report temporary error in restore. --- ndb/tools/restore/consumer.hpp | 1 + ndb/tools/restore/consumer_restore.cpp | 6 ++++++ ndb/tools/restore/consumer_restore.hpp | 3 +++ ndb/tools/restore/restore_main.cpp | 11 +++++++++++ 4 files changed, 21 insertions(+) diff --git a/ndb/tools/restore/consumer.hpp b/ndb/tools/restore/consumer.hpp index 692c814159f..6a8ef29e295 100644 --- a/ndb/tools/restore/consumer.hpp +++ b/ndb/tools/restore/consumer.hpp @@ -31,6 +31,7 @@ public: virtual void logEntry(const LogEntry &){} virtual void endOfLogEntrys(){} virtual bool finalize_table(const TableS &){return true;} + virtual bool has_temp_error() {return false;} }; #endif diff --git a/ndb/tools/restore/consumer_restore.cpp b/ndb/tools/restore/consumer_restore.cpp index 70ea7460d78..14c02b66bfc 100644 --- a/ndb/tools/restore/consumer_restore.cpp +++ b/ndb/tools/restore/consumer_restore.cpp @@ -139,6 +139,11 @@ BackupRestore::finalize_table(const TableS & table){ return ret; } +bool +BackupRestore::has_temp_error(){ + return m_temp_error; +} + bool BackupRestore::table(const TableS & table){ if (!m_restore && !m_restore_meta) @@ -437,6 +442,7 @@ bool BackupRestore::errorHandler(restore_callback_t *cb) case NdbError::TemporaryError: err << "Temporary error: " << error << endl; + m_temp_error = true; NdbSleep_MilliSleep(sleepTime); return true; // RETRY diff --git a/ndb/tools/restore/consumer_restore.hpp b/ndb/tools/restore/consumer_restore.hpp index df219cd4412..261b108b184 100644 --- a/ndb/tools/restore/consumer_restore.hpp +++ b/ndb/tools/restore/consumer_restore.hpp @@ -41,6 +41,7 @@ public: m_parallelism = parallelism; m_callback = 0; m_free_callback = 0; + m_temp_error = false; m_transactions = 0; m_cache.m_old_table = 0; } @@ -60,6 +61,7 @@ public: virtual void logEntry(const LogEntry &); virtual void endOfLogEntrys(); virtual bool finalize_table(const TableS &); + virtual bool has_temp_error(); void connectToMysql(); Ndb * m_ndb; bool m_restore; @@ -72,6 +74,7 @@ public: restore_callback_t *m_callback; restore_callback_t *m_free_callback; + bool m_temp_error; /** * m_new_table_ids[X] = Y; diff --git a/ndb/tools/restore/restore_main.cpp b/ndb/tools/restore/restore_main.cpp index d786dffe89e..779447306af 100644 --- a/ndb/tools/restore/restore_main.cpp +++ b/ndb/tools/restore/restore_main.cpp @@ -411,6 +411,17 @@ main(int argc, char** argv) } } } + for(Uint32 i= 0; i < g_consumers.size(); i++) + { + if (g_consumers[i]->has_temp_error()) + { + clearConsumers(); + ndbout_c("\nRestore successful, but encountered temporary error, " + "please look at configuration."); + return NDBT_ProgramExit(NDBT_TEMPORARY); + } + } + clearConsumers(); return NDBT_ProgramExit(NDBT_OK); } // main