diff options
author | unknown <jonas@perch.ndb.mysql.com> | 2006-09-29 11:47:35 +0200 |
---|---|---|
committer | unknown <jonas@perch.ndb.mysql.com> | 2006-09-29 11:47:35 +0200 |
commit | 42070e192e1e6fd150d184a04afb0b75330435f9 (patch) | |
tree | eed9a19380e5cb47a4cb47a5682bf7f9c798217b /ndb/tools | |
parent | abdc8c11f9f2e798e706978601d841ca34b698c5 (diff) | |
parent | a0a664c837e72e7468594014325cff0800ecd4b2 (diff) | |
download | mariadb-git-42070e192e1e6fd150d184a04afb0b75330435f9.tar.gz |
Merge perch.ndb.mysql.com:/home/jonas/src/tmp/mysql-4.1-ndb
into perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-ndb-bj
Diffstat (limited to 'ndb/tools')
-rw-r--r-- | ndb/tools/ndb_config.cpp | 2 | ||||
-rw-r--r-- | ndb/tools/restore/consumer.hpp | 1 | ||||
-rw-r--r-- | ndb/tools/restore/consumer_restore.cpp | 6 | ||||
-rw-r--r-- | ndb/tools/restore/consumer_restore.hpp | 3 | ||||
-rw-r--r-- | ndb/tools/restore/restore_main.cpp | 11 |
5 files changed, 22 insertions, 1 deletions
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=<id>;][host=]<hostname>[:<port>]\". " - "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", 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 @@ -140,6 +140,11 @@ BackupRestore::finalize_table(const TableS & table){ } bool +BackupRestore::has_temp_error(){ + return m_temp_error; +} + +bool BackupRestore::table(const TableS & table){ if (!m_restore && !m_restore_meta) return true; @@ -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 |