]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix incorrect l_pq_executing_ops statistics when meet an invalid item in purge... 25559/head
authorTang Junhui <tangjunhui@sangfor.com>
Fri, 23 Nov 2018 02:04:40 +0000 (10:04 +0800)
committerNathan Cutler <ncutler@suse.com>
Fri, 14 Dec 2018 10:24:08 +0000 (11:24 +0100)
l_pq_executing_ops should subtract the ops we added previous
in the condition we meet an invalid item in the purge queue,
otherwise the statistics would always show some ops
in l_pq_executing_ops.

Signed-off-by: Junhui Tang <tangjunhui@sangfor.com.cn>
Fixes: http://tracker.ceph.com/issues/37567
(cherry picked from commit ca61ce4485a56dead04a31e47bd1093217d1f222)

src/mds/PurgeQueue.cc

index 33f3cb5afb827491bca077b026a60149b64e7456..330b120d0f8ece397c77403a46a453aaf663e2c2 100644 (file)
@@ -457,7 +457,8 @@ void PurgeQueue::_execute_item(
 
   in_flight[expire_to] = item;
   logger->set(l_pq_executing, in_flight.size());
-  ops_in_flight += _calculate_ops(item);
+  auto ops = _calculate_ops(item);
+  ops_in_flight += ops;
   logger->set(l_pq_executing_ops, ops_in_flight);
 
   SnapContext nullsnapc;
@@ -524,6 +525,8 @@ void PurgeQueue::_execute_item(
   } else {
     derr << "Invalid item (action=" << item.action << ") in purge queue, "
             "dropping it" << dendl;
+    ops_in_flight -= ops;
+    logger->set(l_pq_executing_ops, ops_in_flight);
     in_flight.erase(expire_to);
     logger->set(l_pq_executing, in_flight.size());
     return;