return (count);
}
+ /// @brief Attempts to reconnect the server to the config DB backend manager.
+ ///
+ /// This is a self-rescheduling function that attempts to reconnect to the
+ /// server's host DB backends after connectivity to one or more have been
+ /// lost. Upon entry it will attempt to reconnect via
+ /// @ref ConfigBackendDHCPv4Mgr.addBackend.
+ /// If this is successful, DHCP servicing is re-enabled and server returns
+ /// to normal operation.
+ ///
+ /// If reconnection fails and the maximum number of retries has not been
+ /// exhausted, it will schedule a call to itself to occur at the
+ /// configured retry interval. DHCP service remains disabled.
+ ///
+ /// If the maximum number of retries has been exhausted an error is logged
+ /// and the server shuts down.
+ ///
+ /// @param db_reconnect_ctl pointer to the ReconnectCtl containing the
+ /// configured reconnect parameters.
+ /// @return true if connection has been recovered, false otherwise.
static bool dbReconnect(ReconnectCtlPtr db_reconnect_ctl) {
DatabaseConnection::invokeDbLostCallback(db_reconnect_ctl);
return (count);
}
+ /// @brief Attempts to reconnect the server to the config DB backend manager.
+ ///
+ /// This is a self-rescheduling function that attempts to reconnect to the
+ /// server's host DB backends after connectivity to one or more have been
+ /// lost. Upon entry it will attempt to reconnect via
+ /// @ref ConfigBackendDHCPv6Mgr.addBackend.
+ /// If this is successful, DHCP servicing is re-enabled and server returns
+ /// to normal operation.
+ ///
+ /// If reconnection fails and the maximum number of retries has not been
+ /// exhausted, it will schedule a call to itself to occur at the
+ /// configured retry interval. DHCP service remains disabled.
+ ///
+ /// If the maximum number of retries has been exhausted an error is logged
+ /// and the server shuts down.
+ ///
+ /// @param db_reconnect_ctl pointer to the ReconnectCtl containing the
+ /// configured reconnect parameters.
+ /// @return true if connection has been recovered, false otherwise.
static bool dbReconnect(ReconnectCtlPtr db_reconnect_ctl) {
DatabaseConnection::invokeDbLostCallback(db_reconnect_ctl);
/// connection.
///
/// @return true if there is at least one unusable connection, false
- /// otherwise
+ /// otherwise.
virtual bool isUnusable() {
return (false);
}
- /// @brief Return backend parameters
+ /// @brief Return backend parameters.
///
- /// Returns the backend parameters
+ /// Returns the backend parameters.
///
/// @return Parameters of the backend.
virtual isc::db::DatabaseConnection::ParameterMap getParameters() const {
/// specific parameters.
/// This should have the effect of closing the database connection.
///
- /// @param db_type Backend to remove
+ /// @param db_type Backend to remove.
/// @param dbaccess Database access string being a collection of
/// key=value pairs.
/// @param if_unusable Flag which indicates if the config backend manager
/// @brief Deletes all backends of the given type from the pool.
///
- /// @param db_type Backend to remove
+ /// @param db_type Backend to remove.
void delAllBackends(const std::string& db_type) {
typename std::list<ConfigBackendTypePtr>::iterator backend = backends_.begin();
/// @brief Deletes all backends of the given type from the pool.
///
- /// @param db_type Backend to remove
+ /// @param db_type Backend to remove.
/// @param dbaccess Database access string being a collection of
/// key=value pairs.
/// @param if_unusable Flag which indicates if the config backend manager
/// @brief The reconnect settings.
///
- /// @brief return The reconnect settings.
+ /// @return The reconnect settings.
ReconnectCtlPtr reconnectCtl() {
return (reconnect_ctl_);
}
: parameters_(parameters), ip_reservations_unique_(true), unusable_(false),
timer_name_("") {
+ timer_name_ = "MySqlHostMgr[";
+ timer_name_ += boost::lexical_cast<std::string>(reinterpret_cast<uint64_t>(this));
+ timer_name_ += "]DbReconnectTimer";
+
// Validate the schema version first.
std::pair<uint32_t, uint32_t> code_version(MYSQL_SCHEMA_VERSION_MAJOR,
MYSQL_SCHEMA_VERSION_MINOR);
auto db_reconnect_ctl = pool_->pool_[0]->conn_.reconnectCtl();
- timer_name_ = "MySqlHostMgr[";
- timer_name_ += boost::lexical_cast<std::string>(reinterpret_cast<uint64_t>(this));
- timer_name_ += "]DbReconnectTimer";
-
TimerMgr::instance()->registerTimer(timer_name_,
std::bind(&MySqlHostDataSourceImpl::dbReconnect, db_reconnect_ctl),
db_reconnect_ctl->retryInterval(),
try {
CfgDbAccessPtr cfg_db = CfgMgr::instance().getCurrentCfg()->getCfgDbAccess();
LeaseMgrFactory::destroy();
- LeaseMgrFactory::create(cfg_db->getLeaseDbAccessString()/*, io_service_ */);
+ LeaseMgrFactory::create(cfg_db->getLeaseDbAccessString());
reopened = true;
} catch (const std::exception& ex) {