2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 15:35:17 +00:00

[2524] Added commit and rollback trace messages

This commit is contained in:
Stephen Morris
2012-12-18 12:35:43 +00:00
parent 593eacf16f
commit 46cf8771c2
3 changed files with 21 additions and 0 deletions

View 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.

View 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);
}

View 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_));
}