]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PrimaryLogPG: fix last_peering_reset checking on manifest flushing 26778/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Wed, 6 Mar 2019 06:11:16 +0000 (14:11 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Wed, 6 Mar 2019 06:28:55 +0000 (14:28 +0800)
```handle_manifest_flush``` is obviously using the wrong
**last_peering_reset** to check whether a new peering procedure
has been re-initialized by then.

Fix by using a different alias of the local copy of the
pg-wide **last_peering_reset** variable, which is less confusing and
error-prone.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/PrimaryLogPG.cc
src/osd/PrimaryLogPG.h

index b588cba9cc85d24cf3c5af73e8e4d3329602fcd8..51713b294145cd0891a813fdac86186eeae748a5 100644 (file)
@@ -2546,27 +2546,28 @@ PrimaryLogPG::cache_result_t PrimaryLogPG::maybe_handle_manifest_detail(
 struct C_ManifestFlush : public Context {
   PrimaryLogPGRef pg;
   hobject_t oid;
-  epoch_t last_peering_reset;
+  epoch_t lpr;
   ceph_tid_t tid;
   utime_t start;
   uint64_t offset;
   uint64_t last_offset;
-  C_ManifestFlush(PrimaryLogPG *p, hobject_t o, epoch_t lpr)
-    : pg(p), oid(o), last_peering_reset(lpr),
+  C_ManifestFlush(PrimaryLogPG *p, hobject_t o, epoch_t e)
+    : pg(p), oid(o), lpr(e),
       tid(0), start(ceph_clock_now())
   {}
   void finish(int r) override {
     if (r == -ECANCELED)
       return;
     pg->lock();
-    pg->handle_manifest_flush(oid, tid, r, offset, last_offset);
+    pg->handle_manifest_flush(oid, tid, r, offset, last_offset, lpr);
     pg->osd->logger->tinc(l_osd_tier_flush_lat, ceph_clock_now() - start);
     pg->unlock();
   }
 };
 
 void PrimaryLogPG::handle_manifest_flush(hobject_t oid, ceph_tid_t tid, int r,
-                                        uint64_t offset, uint64_t last_offset)
+                                         uint64_t offset, uint64_t last_offset,
+                                         epoch_t lpr)
 {
   map<hobject_t,FlushOpRef>::iterator p = flush_ops.find(oid);
   if (p == flush_ops.end()) {
@@ -2585,7 +2586,7 @@ void PrimaryLogPG::handle_manifest_flush(hobject_t oid, ceph_tid_t tid, int r,
     }
   }
   if (p->second->chunks == p->second->io_results.size()) {
-    if (last_peering_reset == get_last_peering_reset()) {
+    if (lpr == get_last_peering_reset()) {
       ceph_assert(p->second->obc);
       finish_manifest_flush(oid, tid, r, p->second->obc, last_offset);
     }
index 958a657378e16d873ad83ca725f8f041a58ca8a4..1fdc11d4b11e6a9e65c2230fe9f953de3d1db8f0 100644 (file)
@@ -1427,7 +1427,7 @@ protected:
   void finish_manifest_flush(hobject_t oid, ceph_tid_t tid, int r, ObjectContextRef obc, 
                             uint64_t last_offset);
   void handle_manifest_flush(hobject_t oid, ceph_tid_t tid, int r,
-                            uint64_t offset, uint64_t last_offset);
+                            uint64_t offset, uint64_t last_offset, epoch_t lpr);
   void refcount_manifest(ObjectContextRef obc, object_locator_t oloc, hobject_t soid,
                          SnapContext snapc, bool get, Context *cb, uint64_t offset);