IDO: Do not terminate Icinga 2 if the database schema version does not match

Instead, log an error and continue.

fixes #4440
This commit is contained in:
Michael Friedrich 2017-03-28 10:16:07 +02:00
parent 39ca1b8460
commit 900b33dc5d
2 changed files with 4 additions and 4 deletions

View File

@ -288,7 +288,7 @@ void IdoMysqlConnection::Reconnect(void)
Log(LogCritical, "IdoMysqlConnection", "Schema does not provide any valid version! Verify your schema installation."); Log(LogCritical, "IdoMysqlConnection", "Schema does not provide any valid version! Verify your schema installation.");
Application::Exit(EXIT_FAILURE); BOOST_THROW_EXCEPTION(std::runtime_error("Invalid schema."));
} }
DiscardRows(result); DiscardRows(result);
@ -305,7 +305,7 @@ void IdoMysqlConnection::Reconnect(void)
<< "Schema version '" << version << "' does not match the required version '" << "Schema version '" << version << "' does not match the required version '"
<< IDO_COMPAT_SCHEMA_VERSION << "' (or newer)! Please check the upgrade documentation."; << IDO_COMPAT_SCHEMA_VERSION << "' (or newer)! Please check the upgrade documentation.";
Application::Exit(EXIT_FAILURE); BOOST_THROW_EXCEPTION(std::runtime_error("Schema version mismatch."));
} }
String instanceName = GetInstanceName(); String instanceName = GetInstanceName();

View File

@ -251,7 +251,7 @@ void IdoPgsqlConnection::Reconnect(void)
Log(LogCritical, "IdoPgsqlConnection", "Schema does not provide any valid version! Verify your schema installation."); Log(LogCritical, "IdoPgsqlConnection", "Schema does not provide any valid version! Verify your schema installation.");
Application::Exit(EXIT_FAILURE); BOOST_THROW_EXCEPTION(std::runtime_error("Invalid schema."));
} }
String version = row->Get("version"); String version = row->Get("version");
@ -266,7 +266,7 @@ void IdoPgsqlConnection::Reconnect(void)
<< "Schema version '" << version << "' does not match the required version '" << "Schema version '" << version << "' does not match the required version '"
<< IDO_COMPAT_SCHEMA_VERSION << "' (or newer)! Please check the upgrade documentation."; << IDO_COMPAT_SCHEMA_VERSION << "' (or newer)! Please check the upgrade documentation.";
Application::Exit(EXIT_FAILURE); BOOST_THROW_EXCEPTION(std::runtime_error("Schema version mismatch."));
} }
String instanceName = GetInstanceName(); String instanceName = GetInstanceName();