]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2524] Added commit and rollback trace messages
authorStephen Morris <stephen@isc.org>
Tue, 18 Dec 2012 12:35:43 +0000 (12:35 +0000)
committerStephen Morris <stephen@isc.org>
Tue, 18 Dec 2012 12:35:43 +0000 (12:35 +0000)
src/lib/dhcpsrv/dhcpsrv_messages.mes
src/lib/dhcpsrv/memfile_lease_mgr.cc
src/lib/dhcpsrv/mysql_lease_mgr.cc

index 90f7a41f0a30f99cd6742c4e119ec5a27196aa32..a3e0c9226a1977df389f4c19cab3c8eec9fbd8f2 100644 (file)
@@ -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.
index 5b5fac9df74ac82ccda7a2213bf754fdc6954969..cd46b35c8972834cbab93f2a1d41a422612fdfb5 100644 (file)
@@ -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);
 }
index 36cc9456b82faa53d57e001f1b5dbebe249bf738..7d93df1b5757a30fda8fdf982f87a9b38e068cc0 100644 (file)
@@ -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_));
     }