diff --git a/storage/ndb/tools/restore/consumer.hpp b/storage/ndb/tools/restore/consumer.hpp index 5a09bf54270..d5c6d38985a 100644 --- a/storage/ndb/tools/restore/consumer.hpp +++ b/storage/ndb/tools/restore/consumer.hpp @@ -39,6 +39,7 @@ public: virtual bool update_apply_status(const RestoreMetaData &metaData){return true;} NODE_GROUP_MAP *m_nodegroup_map; uint m_nodegroup_map_len; + virtual bool has_temp_error() {return false;} }; #endif diff --git a/storage/ndb/tools/restore/consumer_restore.cpp b/storage/ndb/tools/restore/consumer_restore.cpp index 44f4b770b05..507058e2743 100644 --- a/storage/ndb/tools/restore/consumer_restore.cpp +++ b/storage/ndb/tools/restore/consumer_restore.cpp @@ -606,6 +606,11 @@ BackupRestore::object(Uint32 type, const void * ptr) return true; } +bool +BackupRestore::has_temp_error(){ + return m_temp_error; +} + bool BackupRestore::update_apply_status(const RestoreMetaData &metaData) { @@ -1100,6 +1105,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/storage/ndb/tools/restore/consumer_restore.hpp b/storage/ndb/tools/restore/consumer_restore.hpp index 4389f71724e..c1d9472aea0 100644 --- a/storage/ndb/tools/restore/consumer_restore.hpp +++ b/storage/ndb/tools/restore/consumer_restore.hpp @@ -51,6 +51,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; } @@ -71,6 +72,7 @@ public: virtual void logEntry(const LogEntry &); virtual void endOfLogEntrys(); virtual bool finalize_table(const TableS &); + virtual bool has_temp_error(); virtual bool update_apply_status(const RestoreMetaData &metaData); void connectToMysql(); bool map_in_frm(char *new_data, const char *data, @@ -96,6 +98,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/storage/ndb/tools/restore/restore_main.cpp b/storage/ndb/tools/restore/restore_main.cpp index d76cf441dd6..8070dba9bf6 100644 --- a/storage/ndb/tools/restore/restore_main.cpp +++ b/storage/ndb/tools/restore/restore_main.cpp @@ -668,6 +668,7 @@ main(int argc, char** argv) } } } + if (ga_restore_epoch) { for (i= 0; i < g_consumers.size(); i++) @@ -678,6 +679,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