]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
PGLog: split divergent priors as well 4631/head
authorNathan Cutler <ncutler@suse.cz>
Sun, 10 May 2015 15:13:22 +0000 (17:13 +0200)
committerNathan Cutler <ncutler@suse.cz>
Sun, 10 May 2015 15:13:22 +0000 (17:13 +0200)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit bbe231a61fc06a1a668e6b831fb8224526721f93)

Conflicts:
    src/osd/PGLog.h

    The cherry-picked commit did not compile as-is, because the hobject_t
    class in firefly lacks a get_hash() method, which was added in 6de83d4.
    To get the patch to compile, I replaced i->second.get_hash() with
    i->second.hash.

src/osd/PGLog.h

index c1563f8d91431ae1ac34fb94c05a36b68bf8e685..18739f5094486bfbe6b84f9d79fb6e06505ae057 100644 (file)
@@ -397,6 +397,19 @@ public:
     missing.split_into(child_pgid, split_bits, &(opg_log->missing));
     opg_log->mark_dirty_to(eversion_t::max());
     mark_dirty_to(eversion_t::max());
+
+    unsigned mask = ~((~0)<<split_bits);
+    for (map<eversion_t, hobject_t>::iterator i = divergent_priors.begin();
+        i != divergent_priors.end();
+        ) {
+      if ((i->second.hash & mask) == child_pgid.m_seed) {
+       opg_log->add_divergent_prior(i->first, i->second);
+       divergent_priors.erase(i++);
+       dirty_divergent_priors = true;
+      } else {
+       ++i;
+      }
+    }
   }
 
   void recover_got(hobject_t oid, eversion_t v, pg_info_t &info) {