]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Add killpoints for mds export
authorGreg Farnum <gregf@hq.newdream.net>
Thu, 3 Dec 2009 18:54:58 +0000 (10:54 -0800)
committerGreg Farnum <gregf@hq.newdream.net>
Thu, 3 Dec 2009 21:43:43 +0000 (13:43 -0800)
src/doc/killpoints.txt
src/mds/Migrator.cc
src/mds/Migrator.h

index 1d83295774bcb3a5a9bff62f6520ab9432dda600..e894ab3a9688dca54037fa671a90c1da1cccc96a 100644 (file)
@@ -6,4 +6,15 @@ mds_kill_import_at
 mds_kill_export_at:
 1: After moving to STATE_EXPORTING
 2: After sending MExportDirDiscover
-3: After recieving MExportDirDiscoverAck and auth_unpin'ing.
\ No newline at end of file
+3: After recieving MExportDirDiscoverAck and auth_unpin'ing.
+4: After sending MExportDirPrep
+5: After receiving MExportDirPrepAck
+6: After sending out MExportDirNotify to all replicas
+7: After switching to state EXPORT_EXPORTING
+   (all replicas have acked ExportDirNotify)
+8: After sending MExportDir to recipient
+9: After receipt of MExportAck (new state: EXPORT_LOGGINGFINISH)
+10: After logging EExport to journal
+11: After sending out MExportDirNotify (new state: EXPORT_NOTIFYING)
+12: After receiving MExportDirNotifyAck from all bystanders
+13: After sending MExportDirFinish to importer
index 62fa0545ce78ebdba01b1104a2ae8431988a7e25..e62c4126e54fe7d4d66d69288ce5c27da4425d0c 100644 (file)
@@ -735,6 +735,7 @@ void Migrator::export_frozen(CDir *dir)
   // send.
   export_state[dir] = EXPORT_PREPPING;
   mds->send_message_mds(prep, dest);
+  assert (mds_kill_export_at != 4);
 }
 
 void Migrator::handle_export_prep_ack(MExportDirPrepAck *m)
@@ -752,6 +753,7 @@ void Migrator::handle_export_prep_ack(MExportDirPrepAck *m)
     return;
   }
 
+  assert (mds_kill_export_at != 5);
   // send warnings
   int dest = export_peer[dir];
   set<CDir*> bounds;
@@ -780,6 +782,7 @@ void Migrator::handle_export_prep_ack(MExportDirPrepAck *m)
   }
   export_state[dir] = EXPORT_WARNING;
 
+  assert(mds_kill_export_at != 6);
   // nobody to warn?
   if (export_warning_ack_waiting.count(dir) == 0) 
     export_go(dir);  // start export.
@@ -820,6 +823,7 @@ void Migrator::export_go_synced(CDir *dir)
   
   export_warning_ack_waiting.erase(dir);
   export_state[dir] = EXPORT_EXPORTING;
+  assert(kill_mds_export_at != 7);
 
   assert(dir->get_cum_auth_pins() == 0);
 
@@ -849,6 +853,7 @@ void Migrator::export_go_synced(CDir *dir)
 
   // send
   mds->send_message_mds(req, dest);
+  assert(kill_mds_export_at != 8);
 
   // stats
   if (mds->logger) mds->logger->inc(l_mds_ex);
@@ -1124,7 +1129,7 @@ void Migrator::handle_export_ack(MExportDirAck *m)
   export_warning_ack_waiting.erase(dir);
   
   export_state[dir] = EXPORT_LOGGINGFINISH;
-  
+  assert (mds_kill_export_at != 9);
   set<CDir*> bounds;
   cache->get_subtree_bounds(dir, bounds);
 
@@ -1148,6 +1153,7 @@ void Migrator::handle_export_ack(MExportDirAck *m)
   mds->mdlog->submit_entry(le);
   mds->mdlog->wait_for_safe(new C_MDS_ExportFinishLogged(this, dir));
   mds->mdlog->flush();
+  assert (mds_kill_export_at != 10);
   
   delete m;
 }
@@ -1252,6 +1258,7 @@ void Migrator::export_logged_finish(CDir *dir)
 
   // wait for notifyacks
   export_state[dir] = EXPORT_NOTIFYING;
+  assert (mds_kill_export_at != 11);
   
   // no notifies to wait for?
   if (export_notify_ack_waiting[dir].empty())
@@ -1315,6 +1322,7 @@ void Migrator::export_finish(CDir *dir)
 {
   dout(5) << "export_finish " << *dir << dendl;
 
+  assert (mds_kill_export_at != 12);
   if (export_state.count(dir) == 0) {
     dout(7) << "target must have failed, not sending final commit message.  export succeeded anyway." << dendl;
     return;
@@ -1326,6 +1334,7 @@ void Migrator::export_finish(CDir *dir)
   } else {
     dout(7) << "not sending MExportDirFinish, dest has failed" << dendl;
   }
+  assert(mds_kill_export_at != 13);
   
   // finish export (adjust local cache state)
   C_Contexts *fin = new C_Contexts;
index 5f0e93f442e6480ec50c35d7352b941d70dccdbe..ff399d3beacde9fec3c2746dce4aaf92e5931581 100644 (file)
@@ -10,6 +10,8 @@
  * License version 2.1, as published by the Free Software 
  * Foundation.  See file COPYING.
  * 
+ * Handles the import and export of authority for mds cache data.
+ * See src/doc/exports.txt for a general description.
  */
 
 #ifndef __MDS_MIGRATOR_H