]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add check to detect interval change
authorKen Iizawa <iizawa.ken@fujitsu.com>
Mon, 8 Feb 2021 08:36:53 +0000 (17:36 +0900)
committerKen Iizawa <iizawa.ken@fujitsu.com>
Mon, 8 Feb 2021 08:36:53 +0000 (17:36 +0900)
Fixes: https://tracker.ceph.com/issues/48182
Signed-off-by: Ken Iizawa <iizawa.ken@fujitsu.com>
src/osd/PrimaryLogPG.cc

index 5438cb55c54bb4c16333db1fed2e85343f4ee858..7ee9c73f0e2905b3b475346917fafb63f02171a0 100644 (file)
@@ -10082,7 +10082,9 @@ struct C_gather : public Context {
   PrimaryLogPGRef pg;
   hobject_t oid;
   PrimaryLogPG::OpContext *ctx;
-  C_gather(PrimaryLogPG *pg_, hobject_t oid_, PrimaryLogPG::OpContext *ctx_) : pg(pg_), oid(oid_), ctx(ctx_) {}
+  epoch_t last_peering_reset;
+  C_gather(PrimaryLogPG *pg_, hobject_t oid_, PrimaryLogPG::OpContext *ctx_, epoch_t lpr_) :
+    pg(pg_), oid(oid_), ctx(ctx_), last_peering_reset(lpr_) {}
   void finish(int r) override {
     if (r == -ECANCELED)
       return;
@@ -10092,6 +10094,9 @@ struct C_gather : public Context {
       // op was cancelled
       return;
     }
+    if (last_peering_reset != pg->get_last_peering_reset()) {
+      return;
+    }
     pg->cls_gather_set_result(p, r);
     pg->execute_ctx(ctx);
   }
@@ -10128,7 +10133,7 @@ int PrimaryLogPG::start_cls_gather(OpContext *ctx, std::map<std::string, bufferl
     dout(10) << __func__ << " src=" << oid << ", tgt=" << soid << dendl;
   }
   
-  C_gather *fin = new C_gather(this, soid, ctx);
+  C_gather *fin = new C_gather(this, soid, ctx, get_last_peering_reset());
   gather.set_finisher(new C_OnFinisher(fin,
                                       osd->get_objecter_finisher(get_pg_shard())));
   gather.activate();