]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
PGLog: allow for empty pg log in update_range if log_tail == eversion_t()
authorSamuel Just <sam.just@inktank.com>
Mon, 9 Dec 2013 17:09:45 +0000 (09:09 -0800)
committerSamuel Just <sam.just@inktank.com>
Wed, 22 Jan 2014 22:39:14 +0000 (14:39 -0800)
Signed-off-by: Samuel Just <sam.just@inktank.com>
src/osd/ReplicatedPG.cc

index aa30d2e19f2f217787fb15c31548cda476a0094c..f4a6f7c13d8fea92f35e2d9cec343ede26fdf911 100644 (file)
@@ -9494,6 +9494,16 @@ void ReplicatedPG::update_range(
     dout(10) << __func__<< ": bi is current " << dendl;
     assert(bi->version == info.last_update);
   } else if (bi->version >= info.log_tail) {
+    if (pg_log.get_log().empty()) {
+      /* Because we don't move log_tail on split, the log might be
+       * empty even if log_tail != last_update.  However, the only
+       * way to get here with an empty log is if log_tail is actually
+       * eversion_t(), because otherwise the entry which changed
+       * last_update since the last scan would have to be present.
+       */
+      assert(bi->version == eversion_t());
+      return;
+    }
     assert(!pg_log.get_log().empty());
     dout(10) << __func__<< ": bi is old, (" << bi->version
             << ") can be updated with log" << dendl;