lwt: add counter for a case where timeout is sent prematurely

There is a case in current PAXOS implementation where timeout is
returned because the code cannot guaranty whether the value is accepted
or not in case of a contention. The counter will help to correlate this
condition with failed requests.
Message-Id: <20200211160653.30317-2-gleb@scylladb.com>
This commit is contained in:
Gleb Natapov
2020-02-11 18:06:53 +02:00
committed by Avi Kivity
parent 7694f164c4
commit ed3e423922
2 changed files with 6 additions and 0 deletions

View File

@@ -1154,6 +1154,7 @@ future<bool> paxos_response_handler::accept_proposal(const paxos::proposal& prop
// accepted, either.
paxos::paxos_state::logger.trace("CAS[{}] accept_proposal: proposal is partially rejected", _id);
tracing::trace(tr_state, "accept_proposal: proposal is partially rejected");
_proxy->get_stats().cas_write_timeout_due_to_uncertainty++;
// TODO: we report write timeout exception to be compatible with Cassandra,
// which uses write_timeout_exception to signal any "unknown" state.
// To be changed in scope of work on https://issues.apache.org/jira/browse/CASSANDRA-15350
@@ -1530,6 +1531,10 @@ void storage_proxy_stats::stats::register_stats() {
sm::description("number of transaction preconditions that did not match current values"),
{storage_proxy_stats::current_scheduling_group_label()}),
sm::make_total_operations("cas_write_timeout_due_to_uncertainty", cas_write_timeout_due_to_uncertainty,
sm::description("how many times write timeout was reported because of uncertainty in the result"),
{storage_proxy_stats::current_scheduling_group_label()}),
sm::make_histogram("cas_read_contention", sm::description("how many contended reads were encountered"),
{storage_proxy_stats::current_scheduling_group_label()},
[this]{ return cas_read_contention.get_histogram(1, 8);}),

View File

@@ -114,6 +114,7 @@ struct write_stats {
uint64_t cas_write_unfinished_commit = 0;
uint64_t cas_write_condition_not_met = 0;
uint64_t cas_write_timeout_due_to_uncertainty = 0;
std::chrono::microseconds last_mv_flow_control_delay; // delay added for MV flow control in the last request
public: