mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-06-13 04:01:32 +03:00
Reduce transaction debug logging output
- Print transaction state information only if it is active. - Print seqno and flags only if they are assigned. - Print SR info only if the transaction is streaming.
This commit is contained in:
@ -2139,34 +2139,54 @@ void wsrep::transaction::cleanup()
|
|||||||
void wsrep::transaction::debug_log_state(
|
void wsrep::transaction::debug_log_state(
|
||||||
const char* context) const
|
const char* context) const
|
||||||
{
|
{
|
||||||
WSREP_LOG_DEBUG(
|
|
||||||
client_state_.debug_log_level(),
|
if (client_state_.debug_log_level() < wsrep::log::debug_level_transaction)
|
||||||
wsrep::log::debug_level_transaction,
|
{
|
||||||
context
|
return;
|
||||||
<< "\n server: " << server_id_
|
}
|
||||||
<< ", client: " << int64_t(client_state_.id().get())
|
|
||||||
|
std::ostringstream oss;
|
||||||
|
oss << context;
|
||||||
|
oss << " server: " << server_id_
|
||||||
|
<< " client: " << int64_t(client_state_.id().get())
|
||||||
<< ", state: " << wsrep::to_c_string(client_state_.state())
|
<< ", state: " << wsrep::to_c_string(client_state_.state())
|
||||||
<< ", mode: " << wsrep::to_c_string(client_state_.mode())
|
<< ", mode: " << wsrep::to_c_string(client_state_.mode())
|
||||||
<< "\n trx_id: " << int64_t(id_.get())
|
<< ", trx_id: " << int64_t(id_.get());
|
||||||
<< ", seqno: " << ws_meta_.seqno().get()
|
|
||||||
<< ", flags: " << flags()
|
if (id_.is_undefined())
|
||||||
<< "\n"
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
oss << "\n"
|
||||||
<< " state: " << wsrep::to_c_string(state_)
|
<< " state: " << wsrep::to_c_string(state_)
|
||||||
<< ", bfa_state: " << wsrep::to_c_string(bf_abort_state_)
|
<< ", bfa_state: " << wsrep::to_c_string(bf_abort_state_)
|
||||||
<< ", error: " << wsrep::to_c_string(client_state_.current_error())
|
<< ", error: " << wsrep::to_c_string(client_state_.current_error())
|
||||||
<< ", status: " << client_state_.current_error_status()
|
<< ", status: " << client_state_.current_error_status();
|
||||||
<< "\n"
|
|
||||||
<< " is_sr: " << is_streaming()
|
if (not ws_meta_.seqno().is_undefined())
|
||||||
|
{
|
||||||
|
oss << "\n seqno: " << ws_meta_.seqno().get()
|
||||||
|
<< ", flags: " << flags();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_streaming())
|
||||||
|
{
|
||||||
|
oss << " is_sr: " << is_streaming()
|
||||||
<< ", frags: " << streaming_context_.fragments_certified()
|
<< ", frags: " << streaming_context_.fragments_certified()
|
||||||
<< ", frags size: " << streaming_context_.fragments().size()
|
<< ", frags size: " << streaming_context_.fragments().size()
|
||||||
<< ", unit: " << streaming_context_.fragment_unit()
|
<< ", unit: " << streaming_context_.fragment_unit()
|
||||||
<< ", size: " << streaming_context_.fragment_size()
|
<< ", size: " << streaming_context_.fragment_size()
|
||||||
<< ", counter: " << streaming_context_.unit_counter()
|
<< ", counter: " << streaming_context_.unit_counter()
|
||||||
<< ", log_pos: " << streaming_context_.log_position()
|
<< ", log_pos: " << streaming_context_.log_position()
|
||||||
<< ", sr_rb: " << streaming_context_.rolled_back()
|
<< ", sr_rb: " << streaming_context_.rolled_back();
|
||||||
<< "\n own: " << (client_state_.owning_thread_id_ == wsrep::this_thread::get_id())
|
}
|
||||||
<< " thread_id: " << client_state_.owning_thread_id_
|
oss << "\n own: "
|
||||||
<< "");
|
<< (client_state_.owning_thread_id_ == wsrep::this_thread::get_id())
|
||||||
|
<< " thread_id: " << client_state_.owning_thread_id_;
|
||||||
|
|
||||||
|
WSREP_LOG_DEBUG(client_state_.debug_log_level(),
|
||||||
|
wsrep::log::debug_level_transaction, oss.str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void wsrep::transaction::debug_log_key_append(const wsrep::key& key) const
|
void wsrep::transaction::debug_log_key_append(const wsrep::key& key) const
|
||||||
|
Reference in New Issue
Block a user