fix too many ERR_BUSY logs problem when write throttling enabled #243
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 是不是改成_counter_recent_write_throtting_count更合适 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. throttling分为delay和reject,只有reject返回ERR_BUSY,并将该counter加1 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 那是不是改成_counter_recent_write_reject_count更合适?总觉得busy有些笼统 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ERR_BUSY未必只有在throttling reject的时候才会返回。 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 嗯,我刚刚看了下代码,rpc busy的时候会返回ERR_BUSY,那还是加上吧 |
||
"recent.write.busy.count", | ||
COUNTER_TYPE_VOLATILE_NUMBER, | ||
"write busy count in the recent period"); | ||
} | ||
|
||
void replica_stub::initialize(bool clear /* = false*/) | ||
|
@@ -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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
现在对read应该没有限流吧,暂时可以不加这个counter吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ERR_BUSY未必只有在throttling reject的时候才会返回,所以还是加上counter_recent_read_busy_count。