From: Stephen Morris Date: Tue, 18 Dec 2012 12:35:43 +0000 (+0000) Subject: [2524] Added commit and rollback trace messages X-Git-Tag: bind10-1.0.0-rc-release~99^2~25^2~6 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=46cf8771c26b220b60ca8f30332442b5a7dbcbef;p=thirdparty%2Fkea.git [2524] Added commit and rollback trace messages --- diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 90f7a41f0a..a3e0c9226a 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -28,6 +28,10 @@ with the specified address to the memory file backend database. A debug message issued when the server is about to add an IPv6 lease with the specified address to the memory file backend database. +% DHCPSRV_MEMFILE_COMMIT commiting to memory file database +The code has issued a commit call. For the memory file database, this is +a no-op. + % DHCPSRV_MEMFILE_DB opening memory file lease database: %1 This informational message is logged when a DHCP server (either V4 or V6) is about to open a memory file lease database. The parameters of @@ -81,6 +85,10 @@ subnet ID and hardware address. A debug message issued when the server is about to obtain schema version information from the memory file database. +% DHCPSRV_MEMFILE_ROLLBACK rolling back memory file database +The code has issued a rollback call. For the memory file database, this is +a no-op. + % DHCPSRV_MEMFILE_UPDATE_ADDR4 updating IPv4 lease for address %1 A debug message issued when the server is attempting to update IPv4 lease from the memory file database for the specified address. @@ -97,6 +105,11 @@ with the specified address to the MySQL backend database. A debug message issued when the server is about to add an IPv6 lease with the specified address to the MySQL backend database. +% DHCPSRV_MYSQL_COMMIT commiting to MySQl database +The code has issued a commit call. All outstanding transactions will be +committed to the database. Note that depending on the MySQL settings, +the commital may not include a write to disk. + % DHCPSRV_MYSQL_DB opening MySQL lease database: %1 This informational message is logged when a DHCP server (either V4 or V6) is about to open a MySQL lease database. The parameters of the @@ -149,6 +162,10 @@ and hardware address. A debug message issued when the server is about to obtain schema version information from the MySQL database. +% DHCPSRV_MYSQL_ROLLBACK rolling back MySQL database +The code has issued a rollback call. All outstanding transaction will +be rolled back and not committed to the database. + % DHCPSRV_MYSQL_UPDATE_ADDR4 updating IPv4 lease for address %1 A debug message issued when the server is attempting to update IPv4 lease from the MySQL database for the specified address. diff --git a/src/lib/dhcpsrv/memfile_lease_mgr.cc b/src/lib/dhcpsrv/memfile_lease_mgr.cc index 5b5fac9df7..cd46b35c89 100644 --- a/src/lib/dhcpsrv/memfile_lease_mgr.cc +++ b/src/lib/dhcpsrv/memfile_lease_mgr.cc @@ -161,8 +161,10 @@ std::string Memfile_LeaseMgr::getDescription() const { void Memfile_LeaseMgr::commit() { + LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_MEMFILE_COMMIT); } void Memfile_LeaseMgr::rollback() { + LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_MEMFILE_ROLLBACK); } diff --git a/src/lib/dhcpsrv/mysql_lease_mgr.cc b/src/lib/dhcpsrv/mysql_lease_mgr.cc index 36cc9456b8..7d93df1b57 100644 --- a/src/lib/dhcpsrv/mysql_lease_mgr.cc +++ b/src/lib/dhcpsrv/mysql_lease_mgr.cc @@ -1719,6 +1719,7 @@ MySqlLeaseMgr::getVersion() const { void MySqlLeaseMgr::commit() { + LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_MYSQL_COMMIT); if (mysql_commit(mysql_) != 0) { isc_throw(DbOperationError, "commit failed: " << mysql_error(mysql_)); } @@ -1727,6 +1728,7 @@ MySqlLeaseMgr::commit() { void MySqlLeaseMgr::rollback() { + LOG_DEBUG(dhcpsrv_logger, DHCPSRV_DBG_TRACE, DHCPSRV_MYSQL_ROLLBACK); if (mysql_rollback(mysql_) != 0) { isc_throw(DbOperationError, "rollback failed: " << mysql_error(mysql_)); }