]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: respond to query on uncreated pg with empty info; do not create
authorSage Weil <sage@newdream.net>
Thu, 10 Dec 2009 17:46:15 +0000 (09:46 -0800)
committerSage Weil <sage@newdream.net>
Thu, 10 Dec 2009 17:46:15 +0000 (09:46 -0800)
We should never create a PG* for an uncreated pg except through the mkpg
path.

src/osd/OSD.cc

index c6b0302c9aa6255ea7edcd06a4d2a507e88cce43..9c23bbb6844b57e22c4e7f2c495147548d37852b 100644 (file)
@@ -3074,6 +3074,7 @@ void OSD::_process_pg_info(epoch_t epoch, int from,
 
     // create pg!
     assert(role != 0);
+    assert(!info.dne());
     pg = _create_lock_pg(info.pgid, t);
     dout(10) << " got info on new pg, creating" << dendl;
     pg->acting.swap(acting);
@@ -3275,6 +3276,13 @@ void OSD::handle_pg_query(MOSDPGQuery *m)
       }
       assert(role > 0);
 
+      if (!history.epoch_created) {
+       dout(10) << " pg " << pgid << " not created, replying with empty info" << dendl;
+        PG::Info empty(pgid);
+        notify_list[from].push_back(empty);
+       continue;
+      }
+
       ObjectStore::Transaction t;
       pg = _create_lock_pg(pgid, t);
       pg->acting.swap( acting );