diff --git a/sql/semisync_master.cc b/sql/semisync_master.cc index 581cf100792..ee4a0161085 100644 --- a/sql/semisync_master.cc +++ b/sql/semisync_master.cc @@ -1,6 +1,6 @@ /* Copyright (C) 2007 Google Inc. Copyright (c) 2008, 2013, Oracle and/or its affiliates. - Copyright (c) 2011, 2016, MariaDB + Copyright (c) 2011, 2022, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -275,12 +275,16 @@ void Active_tranx::clear_active_tranx_nodes(const char *log_file_name, Tranx_node *curr_node, *next_node; /* Delete all transaction nodes before the confirmation point. */ +#ifdef DBUG_TRACE int n_frees = 0; +#endif curr_node = m_trx_front; while (curr_node != new_front) { next_node = curr_node->next; +#ifdef DBUG_TRACE n_frees++; +#endif /* Remove the node from the hash table. */ unsigned int hash_val = get_hash_value(curr_node->log_name, curr_node->log_pos); diff --git a/storage/federatedx/federatedx_txn.cc b/storage/federatedx/federatedx_txn.cc index 220896cc2a4..c434a00805c 100644 --- a/storage/federatedx/federatedx_txn.cc +++ b/storage/federatedx/federatedx_txn.cc @@ -57,10 +57,12 @@ federatedx_txn::~federatedx_txn() void federatedx_txn::close(FEDERATEDX_SERVER *server) { +#ifdef DBUG_TRACE uint count= 0; +#endif federatedx_io *io, **iop; DBUG_ENTER("federatedx_txn::close"); - + DBUG_ASSERT(!server->use_count); DBUG_PRINT("info",("use count: %u connections: %u", server->use_count, server->io_count)); @@ -84,9 +86,11 @@ void federatedx_txn::close(FEDERATEDX_SERVER *server) { server->idle_list= io->idle_next; delete io; +#ifdef DBUG_TRACE count++; +#endif } - + DBUG_PRINT("info",("closed %u connections, txn_list: %s", count, txn_list ? "active": "empty")); DBUG_VOID_RETURN; @@ -172,12 +176,14 @@ void federatedx_txn::release(federatedx_io **ioptr) void federatedx_txn::release_scan() { +#ifdef DBUG_TRACE uint count= 0, returned= 0; +#endif federatedx_io *io, **pio; DBUG_ENTER("federatedx_txn::release_scan"); - /* return any inactive and idle connections to the server */ - for (pio= &txn_list; (io= *pio); count++) + /* return any inactive and idle connections to the server */ + for (pio= &txn_list; (io= *pio);) { if (io->active || io->busy) pio= &io->txn_next; @@ -196,8 +202,13 @@ void federatedx_txn::release_scan() io->idle_next= server->idle_list; server->idle_list= io; mysql_mutex_unlock(&server->mutex); +#ifdef DBUG_TRACE returned++; +#endif } +#ifdef DBUG_TRACE + count++; +#endif } DBUG_PRINT("info",("returned %u of %u connections(s)", returned, count));