]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd/PeeringState: recover_got - add special handler for empty log 30895/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Fri, 20 Sep 2019 07:33:40 +0000 (15:33 +0800)
committerNathan Cutler <ncutler@suse.com>
Mon, 14 Oct 2019 12:27:40 +0000 (14:27 +0200)
If we use a small osd_min[max]_pg_log_entries setting, say, 10, and
do splitting, a child pg may only be able to keep some divergent log
entries in the list. Any follow-up peering cycle on that child pg
would then rewind all the divergent log entries and lead to an empty
log list, which as a result could reliably fire the

  ceph_assert(info.last_complete == info.last_update)

assert if we start to recover any of the missing divergent objects
later.

Fixes: https://tracker.ceph.com/issues/41816
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit a5e9e9099865be7a3d90c58cf3f3fc50ed6eed6d)

Conflicts:
src/osd/PeeringState.cc
- file does not exist in the stable branch: made the changes manually to
  src/osd/PrimaryLogPG.cc

src/osd/PrimaryLogPG.cc

index 49134b0079ba528c5ad3b06cfa7d36733456c2df..dd1ddb6a0b42e219a2eb63faaf5dd06930b72731 100644 (file)
@@ -11514,7 +11514,10 @@ void PrimaryLogPG::recover_got(hobject_t oid, eversion_t v)
 {
   dout(10) << "got missing " << oid << " v " << v << dendl;
   pg_log.recover_got(oid, v, info);
-  if (pg_log.get_log().complete_to != pg_log.get_log().log.end()) {
+  if (pg_log.get_log().log.empty()) {
+    dout(10) << "last_complete now " << info.last_complete
+             << " while log is empty" << dendl;
+  } else if (pg_log.get_log().complete_to != pg_log.get_log().log.end()) {
     dout(10) << "last_complete now " << info.last_complete
             << " log.complete_to " << pg_log.get_log().complete_to->version
             << dendl;