Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

fix: update mutation tracer name to mutation->name() #876

Merged
merged 4 commits into from
Aug 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion include/dsn/utils/latency_tracer.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,12 +93,14 @@ class latency_tracer
// stageA[rpc_message]--stageB[rpc_message]--
void set_sub_tracer(const std::shared_ptr<latency_tracer> &tracer);

void set_name(const std::string &name) { _name = name; }

private:
void dump_trace_points(/*out*/ std::string &traces);

utils::rw_lock_nr _lock;

const std::string _name;
std::string _name;
const uint64_t _threshold;
bool _is_sub;
const uint64_t _start_time;
Expand Down
2 changes: 2 additions & 0 deletions src/replica/replica_2pc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ void replica::init_prepare(mutation_ptr &mu, bool reconciliation, bool pop_all_c
mu->set_id(get_ballot(), mu->data.header.decree);
}

mu->tracer->set_name(fmt::format("mutation[{}]", mu->name()));
dlog(level,
"%s: mutation %s init_prepare, mutation_tid=%" PRIu64,
name(),
Expand Down Expand Up @@ -386,6 +387,7 @@ void replica::on_prepare(dsn::message_ex *request)
decree decree = mu->data.header.decree;

dinfo("%s: mutation %s on_prepare", name(), mu->name());
mu->tracer->set_name(fmt::format("mutation[{}]", mu->name()));

dassert(mu->data.header.pid == rconfig.pid,
"(%d.%d) VS (%d.%d)",
Expand Down