]> git.ipfire.org Git - thirdparty/kea.git/commit
[5477] dhcpsrv/postgres and kea-dhcp4 now support db reconnect
authorThomas Markwalder <tmark@isc.org>
Wed, 28 Feb 2018 20:29:23 +0000 (15:29 -0500)
committerThomas Markwalder <tmark@isc.org>
Wed, 28 Feb 2018 20:29:23 +0000 (15:29 -0500)
commit249219f1fc315bc6d799708c6a8bd3b3f847a951
tree5ec7d9c1ee1466df13f342f5b0281ad4ca62ff7f
parentf124d85d24125ed117d1f56f11dd00f47c047306
[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
34 files changed:
src/bin/dhcp4/ctrl_dhcp4_srv.cc
src/bin/dhcp4/ctrl_dhcp4_srv.h
src/bin/dhcp4/dhcp4_lexer.cc
src/bin/dhcp4/dhcp4_lexer.ll
src/bin/dhcp4/dhcp4_messages.mes
src/bin/dhcp4/dhcp4_parser.cc
src/bin/dhcp4/dhcp4_parser.h
src/bin/dhcp4/dhcp4_parser.yy
src/bin/dhcp4/location.hh
src/bin/dhcp4/position.hh
src/bin/dhcp4/stack.hh
src/bin/dhcp6/location.hh
src/bin/dhcp6/position.hh
src/bin/dhcp6/stack.hh
src/lib/dhcpsrv/cfg_db_access.cc
src/lib/dhcpsrv/cfg_db_access.h
src/lib/dhcpsrv/database_connection.cc
src/lib/dhcpsrv/database_connection.h
src/lib/dhcpsrv/host_data_source_factory.cc
src/lib/dhcpsrv/host_data_source_factory.h
src/lib/dhcpsrv/host_mgr.cc
src/lib/dhcpsrv/host_mgr.h
src/lib/dhcpsrv/lease_mgr_factory.cc
src/lib/dhcpsrv/lease_mgr_factory.h
src/lib/dhcpsrv/parsers/dbaccess_parser.cc
src/lib/dhcpsrv/pgsql_connection.cc
src/lib/dhcpsrv/pgsql_connection.h
src/lib/dhcpsrv/pgsql_host_data_source.cc
src/lib/dhcpsrv/pgsql_host_data_source.h
src/lib/dhcpsrv/pgsql_lease_mgr.cc
src/lib/dhcpsrv/pgsql_lease_mgr.h
src/lib/dhcpsrv/tests/database_connection_unittest.cc
src/lib/dhcpsrv/tests/pgsql_host_data_source_unittest.cc
src/lib/dhcpsrv/tests/pgsql_lease_mgr_unittest.cc