]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: don't open deleted map from generate_past_intervals
authorSage Weil <sage@newdream.net>
Wed, 9 Nov 2011 05:58:11 +0000 (21:58 -0800)
committerSage Weil <sage@newdream.net>
Wed, 9 Nov 2011 05:58:11 +0000 (21:58 -0800)
The first get_map() call needs to be avoided when stop < last_epoch.  This
fixes a crash like

2011-11-08 21:51:09.046739 7fcf6e035700 osd.0 5 pg[1.1p0( empty n=0 ec=1 les/c 3/3 2/2/2) [0,1] r=0 mlcod 0'0 !hml peering] enter Started/Primary/Peering/GetInfo
2011-11-08 21:51:09.046767 7fcf6e035700 osd.0 5 pg[1.1p0( empty n=0 ec=1 les/c 3/3 2/2/2) [0,1] r=0 mlcod 0'0 !hml peering] generate_past_intervals over epochs 4-1
2011-11-08 21:51:09.046796 7fcf6e035700 osd.0 5 get_map 1 - loading and decoding 0x183b000
*** Caught signal (Aborted) **
 in thread 7fcf6e035700
 ceph version 0.37-327-g1bc1a24 (commit:1bc1a244dbf7342662322d002d0c9d41ad5fee6f)

...

Signed-off-by: Sage Weil <sage@newdream.net>
src/osd/PG.cc

index 08bd783d2f18aeb3ad8f08edd9af8977ce28be9a..eea3e168062c16b7de2ec5a1e4ca8e31dba4bc88 100644 (file)
@@ -939,6 +939,13 @@ void PG::generate_past_intervals()
   if (stop < osd->superblock.oldest_map)
     stop = osd->superblock.oldest_map;   // this is a lower bound on last_epoch_clean cluster-wide.     
   epoch_t last_epoch = info.history.same_interval_since - 1;
+
+  if (last_epoch < stop) {
+    dout(10) << __func__ << " last_epoch " << last_epoch << " < oldest " << stop
+            << ", nothing to do" << dendl;
+    return;
+  }
+
   dout(10) << __func__ << " over epochs " << stop << "-" << last_epoch << dendl;
 
   OSDMap *nextmap = osd->get_map(last_epoch);