]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: do not invalidate clear_regions of missing item at boot 29755/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 17 Jun 2019 03:05:31 +0000 (11:05 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Tue, 20 Aug 2019 05:27:34 +0000 (13:27 +0800)
Seems we'll always mark clear_regions as all dirty
when reading pg logs and missing items off the disk,
which as a result turns incremental recovery off by default.
Also using std::move seems to be a bit more efficient
and robust here.

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

index 81927870976c31b757dc529df77a3a8f5420e9be..fc7ffd48aa7238bc6795594911192a0c1ba07f2a 100644 (file)
@@ -1402,7 +1402,7 @@ public:
          if (item.is_delete()) {
            ceph_assert(missing.may_include_deletes);
          }
-         missing.add(oid, item.need, item.have, item.is_delete());
+         missing.add(oid, std::move(item));
        } else if (p->key().substr(0, 4) == string("dup_")) {
          pg_log_dup_t dup;
          decode(dup, bp);
@@ -1650,7 +1650,7 @@ public:
        if (item.is_delete()) {
          ceph_assert(missing.may_include_deletes);
        }
-       missing.add(oid, item.need, item.have, item.is_delete());
+       missing.add(oid, std::move(item));
       } else if (p.first.substr(0, 4) == string("dup_")) {
        pg_log_dup_t dup;
        decode(dup, bp);
index 3e5e71ccdfab5a5ec4e9a04558a593448f899fb6..8aeef17ad01153f5748fa60523571f1533de6f5d 100644 (file)
@@ -4522,6 +4522,12 @@ public:
     tracker.changed(oid);
   }
 
+  void add(const hobject_t& oid, pg_missing_item&& item) {
+    rmissing[item.need.version] = oid;
+    missing.insert({oid, std::move(item)});
+    tracker.changed(oid);
+  }
+
   void rm(const hobject_t& oid, eversion_t v) {
     std::map<hobject_t, item>::iterator p = missing.find(oid);
     if (p != missing.end() && p->second.need <= v)