diff options
author | Thomas Markwalder <tmark@isc.org> | 2018-02-28 21:29:23 +0100 |
---|---|---|
committer | Thomas Markwalder <tmark@isc.org> | 2018-02-28 21:29:23 +0100 |
commit | 249219f1fc315bc6d799708c6a8bd3b3f847a951 (patch) | |
tree | 5ec7d9c1ee1466df13f342f5b0281ad4ca62ff7f /src/lib/dhcpsrv/cfg_db_access.h | |
parent | [master] Updated git hash (diff) | |
download | kea-249219f1fc315bc6d799708c6a8bd3b3f847a951.tar.xz kea-249219f1fc315bc6d799708c6a8bd3b3f847a951.zip |
[5477] dhcpsrv/postgres and kea-dhcp4 now support db reconnect
kea-dhcp4
added support for max-reconnect-tries and reconnect-wait-time
to lease and host db parsers
Added a callback for when DB backends detect loss of connectivity
Added a self-rescheduling method to attempt to reconnect to the
backends if retries are enabled
dhcpsrv
Added a callback that DatabaseConnection derivations should invoke
when they lose connectivity.
Added an optional callback parameter from CfgDbAccess::createManagers()
all the way down to DatabaseConnection ctor.
pgsql_connection.cc
PgSqlConnection::~PgSqlConnection() - Added logic to close the
connection only when the connect state is still OK.
Otherwise it likes to core dump.
PgSqlConnection::checkStatementError() - Modified to invoke the
connectivity lost callback on "fatal" errors
pgsql_lease_mgr_unittest.cc
pgsql_host_data_source_unittest.cc
Added tests to verify that the lost callback is NOT invoked on an
open failure
Diffstat (limited to 'src/lib/dhcpsrv/cfg_db_access.h')
-rw-r--r-- | src/lib/dhcpsrv/cfg_db_access.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/dhcpsrv/cfg_db_access.h b/src/lib/dhcpsrv/cfg_db_access.h index 2c87e4dafc..3459edf1e8 100644 --- a/src/lib/dhcpsrv/cfg_db_access.h +++ b/src/lib/dhcpsrv/cfg_db_access.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -8,6 +8,8 @@ #define CFG_DBACCESS_H #include <cc/cfg_to_element.h> +#include <dhcpsrv/database_connection.h> + #include <boost/shared_ptr.hpp> #include <string> @@ -62,7 +64,11 @@ public: /// @brief Creates instance of lease manager and host data source /// according to the configuration specified. - void createManagers() const; + /// + /// @param db_lost_callback function to invoke if connectivity to + /// either the lease or host managers, once established, is subsequently + /// lost. + void createManagers(DatabaseConnection::Callback db_lost_callback = NULL) const; /// @brief Unparse an access string /// |