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

Commit

Permalink
fix too many ERR_BUSY logs problem when write throttling enabled (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
qinzuoyan authored and neverchanje committed May 30, 2019
1 parent d569122 commit f07999a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/dist/replication/lib/replica_stub.cpp
Expand Up @@ -276,6 +276,14 @@ void replica_stub::install_perf_counters()
"recent.write.fail.count",
COUNTER_TYPE_VOLATILE_NUMBER,
"write fail count in the recent period");
_counter_recent_read_busy_count.init_app_counter("eon.replica_stub",
"recent.read.busy.count",
COUNTER_TYPE_VOLATILE_NUMBER,
"read busy count in the recent period");
_counter_recent_write_busy_count.init_app_counter("eon.replica_stub",
"recent.write.busy.count",
COUNTER_TYPE_VOLATILE_NUMBER,
"write busy count in the recent period");
}

void replica_stub::initialize(bool clear /* = false*/)
Expand Down Expand Up @@ -1332,7 +1340,12 @@ void replica_stub::response_client(gpid id,
partition_status::type status,
error_code error)
{
if (error != ERR_OK) {
if (error == ERR_BUSY) {
if (is_read)
_counter_recent_read_busy_count->increment();
else
_counter_recent_write_busy_count->increment();
} else if (error != ERR_OK) {
if (is_read)
_counter_recent_read_fail_count->increment();
else
Expand Down
2 changes: 2 additions & 0 deletions src/dist/replication/lib/replica_stub.h
Expand Up @@ -321,6 +321,8 @@ class replica_stub : public serverlet<replica_stub>, public ref_counter

perf_counter_wrapper _counter_recent_read_fail_count;
perf_counter_wrapper _counter_recent_write_fail_count;
perf_counter_wrapper _counter_recent_read_busy_count;
perf_counter_wrapper _counter_recent_write_busy_count;

dsn::task_tracker _tracker;
};
Expand Down

0 comments on commit f07999a

Please sign in to comment.