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)
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;
} 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;