mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 23:23:04 +01:00
Improvement CORE-3598 : TRACE: add statistics of actions that were after transaction finished
This commit is contained in:
parent
854231942a
commit
02adff3b63
@ -6232,8 +6232,9 @@ void JTransaction::freeEngineData(Firebird::IStatus* user_status)
|
|||||||
tdbb->getDatabase()->dbb_ast_flags & DBB_shutdown ||
|
tdbb->getDatabase()->dbb_ast_flags & DBB_shutdown ||
|
||||||
tdbb->getAttachment()->att_flags & ATT_shutdown)
|
tdbb->getAttachment()->att_flags & ATT_shutdown)
|
||||||
{
|
{
|
||||||
|
TraceTransactionEnd trace(transaction, false, false);
|
||||||
EDS::Transaction::jrdTransactionEnd(tdbb, transaction, false, false, false);
|
EDS::Transaction::jrdTransactionEnd(tdbb, transaction, false, false, false);
|
||||||
TRA_release_transaction(tdbb, transaction);
|
TRA_release_transaction(tdbb, transaction, &trace);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
TRA_rollback(tdbb, transaction, false, false);
|
TRA_rollback(tdbb, transaction, false, false);
|
||||||
@ -6286,8 +6287,9 @@ static unsigned int purge_transactions(thread_db* tdbb,
|
|||||||
if ((transaction->tra_flags & TRA_prepared) || (dbb->dbb_ast_flags & DBB_shutdown) ||
|
if ((transaction->tra_flags & TRA_prepared) || (dbb->dbb_ast_flags & DBB_shutdown) ||
|
||||||
(att_flags & ATT_shutdown))
|
(att_flags & ATT_shutdown))
|
||||||
{
|
{
|
||||||
|
TraceTransactionEnd trace(transaction, false, false); // need ability to indicate prepared (in limbo) transaction
|
||||||
EDS::Transaction::jrdTransactionEnd(tdbb, transaction, false, false, true);
|
EDS::Transaction::jrdTransactionEnd(tdbb, transaction, false, false, true);
|
||||||
TRA_release_transaction(tdbb, transaction);
|
TRA_release_transaction(tdbb, transaction, &trace);
|
||||||
}
|
}
|
||||||
else if (force_flag)
|
else if (force_flag)
|
||||||
TRA_rollback(tdbb, transaction, false, true);
|
TRA_rollback(tdbb, transaction, false, true);
|
||||||
@ -6307,7 +6309,8 @@ static unsigned int purge_transactions(thread_db* tdbb,
|
|||||||
attachment->att_dbkey_trans = NULL;
|
attachment->att_dbkey_trans = NULL;
|
||||||
if ((dbb->dbb_ast_flags & DBB_shutdown) || (att_flags & ATT_shutdown))
|
if ((dbb->dbb_ast_flags & DBB_shutdown) || (att_flags & ATT_shutdown))
|
||||||
{
|
{
|
||||||
TRA_release_transaction(tdbb, trans_dbk);
|
TraceTransactionEnd trace(trans_dbk, false, false);
|
||||||
|
TRA_release_transaction(tdbb, trans_dbk, &trace);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -410,8 +410,7 @@ void TRA_commit(thread_db* tdbb, jrd_tra* transaction, const bool retaining_flag
|
|||||||
LCK_convert(tdbb, lock, LCK_write, LCK_WAIT);
|
LCK_convert(tdbb, lock, LCK_write, LCK_WAIT);
|
||||||
--transaction->tra_use_count;
|
--transaction->tra_use_count;
|
||||||
|
|
||||||
trace.finish(res_successful);
|
TRA_release_transaction(tdbb, transaction, &trace);
|
||||||
TRA_release_transaction(tdbb, transaction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1012,7 +1011,7 @@ jrd_tra* TRA_reconnect(thread_db* tdbb, const UCHAR* id, USHORT length)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void TRA_release_transaction(thread_db* tdbb, jrd_tra* transaction)
|
void TRA_release_transaction(thread_db* tdbb, jrd_tra* transaction, Jrd::TraceTransactionEnd* trace)
|
||||||
{
|
{
|
||||||
/**************************************
|
/**************************************
|
||||||
*
|
*
|
||||||
@ -1130,6 +1129,9 @@ void TRA_release_transaction(thread_db* tdbb, jrd_tra* transaction)
|
|||||||
if (transaction->tra_flags & TRA_precommitted)
|
if (transaction->tra_flags & TRA_precommitted)
|
||||||
TRA_precommited(tdbb, transaction->tra_number, 0);
|
TRA_precommited(tdbb, transaction->tra_number, 0);
|
||||||
|
|
||||||
|
if (trace)
|
||||||
|
trace->finish(res_successful);
|
||||||
|
|
||||||
// Unlink the transaction from the database block
|
// Unlink the transaction from the database block
|
||||||
|
|
||||||
for (jrd_tra** ptr = &attachment->att_transactions; *ptr; ptr = &(*ptr)->tra_next)
|
for (jrd_tra** ptr = &attachment->att_transactions; *ptr; ptr = &(*ptr)->tra_next)
|
||||||
@ -1314,8 +1316,7 @@ void TRA_rollback(thread_db* tdbb, jrd_tra* transaction, const bool retaining_fl
|
|||||||
|
|
||||||
TRA_set_state(tdbb, transaction, transaction->tra_number, state);
|
TRA_set_state(tdbb, transaction, transaction->tra_number, state);
|
||||||
|
|
||||||
trace.finish(res_successful);
|
TRA_release_transaction(tdbb, transaction, &trace);
|
||||||
TRA_release_transaction(tdbb, transaction);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
namespace Jrd {
|
namespace Jrd {
|
||||||
class Attachment;
|
class Attachment;
|
||||||
class Database;
|
class Database;
|
||||||
|
class TraceTransactionEnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TRA_active_transactions(Jrd::thread_db*, Jrd::Database*);
|
bool TRA_active_transactions(Jrd::thread_db*, Jrd::Database*);
|
||||||
@ -50,7 +51,7 @@ void TRA_post_resources(Jrd::thread_db*, Jrd::jrd_tra*, Jrd::ResourceList&);
|
|||||||
bool TRA_precommited(Jrd::thread_db*, SLONG, SLONG);
|
bool TRA_precommited(Jrd::thread_db*, SLONG, SLONG);
|
||||||
void TRA_prepare(Jrd::thread_db*, Jrd::jrd_tra*, USHORT, const UCHAR*);
|
void TRA_prepare(Jrd::thread_db*, Jrd::jrd_tra*, USHORT, const UCHAR*);
|
||||||
Jrd::jrd_tra* TRA_reconnect(Jrd::thread_db*, const UCHAR*, USHORT);
|
Jrd::jrd_tra* TRA_reconnect(Jrd::thread_db*, const UCHAR*, USHORT);
|
||||||
void TRA_release_transaction(Jrd::thread_db*, Jrd::jrd_tra*);
|
void TRA_release_transaction(Jrd::thread_db*, Jrd::jrd_tra*, Jrd::TraceTransactionEnd*);
|
||||||
void TRA_rollback(Jrd::thread_db*, Jrd::jrd_tra*, const bool, const bool);
|
void TRA_rollback(Jrd::thread_db*, Jrd::jrd_tra*, const bool, const bool);
|
||||||
void TRA_set_state(Jrd::thread_db*, Jrd::jrd_tra*, SLONG, SSHORT);
|
void TRA_set_state(Jrd::thread_db*, Jrd::jrd_tra*, SLONG, SSHORT);
|
||||||
int TRA_snapshot_state(Jrd::thread_db*, const Jrd::jrd_tra*, SLONG);
|
int TRA_snapshot_state(Jrd::thread_db*, const Jrd::jrd_tra*, SLONG);
|
||||||
|
Loading…
Reference in New Issue
Block a user