]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd/osd_operation: fix abort caused by op be deleted ahead 47327/head
authorluo rixin <luorixin@huawei.com>
Thu, 28 Jul 2022 07:52:09 +0000 (15:52 +0800)
committerluo rixin <luorixin@huawei.com>
Thu, 28 Jul 2022 07:53:45 +0000 (15:53 +0800)
There has tracked some history slow ops, when `num_slow_ops` is greater than
`osd_op_history_slow_op_size`, the tracked fastest op should be deleted.
In some case, the `fastest_historic_op` has refcount >= 2, the func `put_historic`
decrease `fastest_historic_op's` refcount and still remain `fastest_historic_op`
in `historic_registry`, `fastest_historic_op's` refcount will be decreased more
than once in func `put_historic`, leading to `fastest_historic_op` be deleted ahead.
So we need erase the `fastest_historic_op` from `historic_registry`.

Signed-off-by: luo rixin <luorixin@huawei.com>
src/crimson/osd/osd_operation.cc

index dec37d95433d4e4cad5ef11d220bd8af54907e6d..63612091cc8b6190b64717943adba4ce634e7fd4 100644 (file)
@@ -94,6 +94,7 @@ void OSDOperationRegistry::put_historic(const ClientRequest& op)
     assert(fastest_historic_iter != std::end(historic_registry));
     const auto& fastest_historic_op =
       static_cast<const ClientRequest&>(*fastest_historic_iter);
+    historic_registry.erase(fastest_historic_iter);
     // clear a previously "leaked" op
     ClientRequest::ICRef(&fastest_historic_op, /* add_ref= */false);
     --num_slow_ops;