]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
common/TrackedOp: fix inaccurate counting for total slow requests
authorxie xingguo <xie.xingguo@zte.com.cn>
Thu, 18 Feb 2016 07:33:19 +0000 (15:33 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Sat, 20 Feb 2016 05:16:10 +0000 (13:16 +0800)
commitb2bfd6cc0ba697414a0abca1bb8a1074abb08993
tree8e2dba166d5a7d5118b3da7875380df8d44d375f
parent037852eab547abf44289dce1edeffbbce54b0fa9
common/TrackedOp: fix inaccurate counting for total slow requests

In the original design there are two counters in charge of collecting
potentially problematic requests, namely 'slow' and 'warned'.
Counter 'slow' is responsible for capturing all the requests which have
already hit the "complain" limit and shall be marked as "slow" while
counter 'warned' is responsible for countering those requests which
have already hit the "warning interval" and thus shall be logged and
then outputted.

The problem here is if 'warned' counter hits the log_threshold,
we will quit the entire for loop but there may be residual shard_queues
which may still containing slow requests. As a result, the 'slow' counter
does not reflect the real number of total slow requests in all the
shard_queues under this case. And no slow requests will be tracked
especially when 'log_threshold' is set to zero(Do we do this intentional?
Or else we shall never allow 'log_threshold' to be zero).

The solution for the above problem is to keep counting 'slow' requests
until we have finished traversing all the shard_queues, no matter
whether we have gathered enough requests for logging or not, and if so,
we simply stop counter 'warned' and skip over logging process.

Fixes: #14804
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/common/TrackedOp.cc