From: Sage Weil Date: Fri, 7 Aug 2009 22:34:24 +0000 (-0700) Subject: osd: ignore info racing with PGRemove X-Git-Tag: v0.13~101 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5828cce0a046105e430a03908ff9beff5edeec0;p=ceph.git osd: ignore info racing with PGRemove We may get multiple infos during peering, because we explicitly query priors AND osds with existing pg data send them (thus we may get 2). The second info can race with a PGRemove. When we get it, we have to realize it's not _new_ stray content.. it's old content we're already purging. --- diff --git a/src/TODO b/src/TODO index 866b1feb3592..bc9418a21fab 100644 --- a/src/TODO +++ b/src/TODO @@ -138,6 +138,7 @@ btrfs - ioctl to pull out data csum? osd +- remove needs to be in a work queue! - what to do with lost objects.. continue peering? - segregate backlog from log ondisk? - preserve pg logs on disk for longer period diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index fce332b6517c..d4e65cd0ae50 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2934,9 +2934,13 @@ void OSD::handle_pg_notify(MOSDPGNotify *m) // stray? bool acting = pg->is_acting(from); if (!acting) { - dout(10) << *pg << " osd" << from << " has stray content: " << *it << dendl; - pg->stray_set.insert(from); - pg->state_clear(PG_STATE_CLEAN); + if (pg->stray_purged.count(from)) { + dout(10) << *pg << " osd" << from << " sent racing info " << *it << "; already purging/purged" << dendl; + } else { + dout(10) << *pg << " osd" << from << " has stray content: " << *it << dendl; + pg->stray_set.insert(from); + pg->state_clear(PG_STATE_CLEAN); + } } if (had) { diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 58bcd1357bd0..e813da472a90 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -1005,6 +1005,7 @@ void PG::clear_primary_state() need_up_thru = false; peer_last_complete_ondisk.clear(); min_last_complete_ondisk = eversion_t(); + stray_purged.clear(); finish_sync_event = 0; // so that _finish_recvoery doesn't go off in another thread @@ -1710,6 +1711,7 @@ void PG::purge_strays() if (osd->osdmap->is_up(*p)) { dout(10) << "sending PGRemove to osd" << *p << dendl; osd->queue_for_removal(*p, info.pgid); + stray_purged.insert(*p); } else { dout(10) << "not sending PGRemove to down osd" << *p << dendl; } diff --git a/src/osd/PG.h b/src/osd/PG.h index 2566b40c70ba..8c01e2dd6ca5 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -699,6 +699,7 @@ public: map peer_missing; set peer_log_requested; // logs i've requested (and start stamps) set peer_summary_requested; + set stray_purged; // i deleted these strays; ignore racing PGInfo from them friend class OSD;