From b6dba80adab02ea4e62a423871883aaf2b302369 Mon Sep 17 00:00:00 2001 From: Greg Farnum Date: Thu, 3 Dec 2009 10:54:58 -0800 Subject: [PATCH] mds: Add killpoints for mds export --- src/doc/killpoints.txt | 13 ++++++++++++- src/mds/Migrator.cc | 11 ++++++++++- src/mds/Migrator.h | 2 ++ 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/doc/killpoints.txt b/src/doc/killpoints.txt index 1d83295774bcb..e894ab3a9688d 100644 --- a/src/doc/killpoints.txt +++ b/src/doc/killpoints.txt @@ -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 diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 62fa0545ce78e..e62c4126e54fe 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -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 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 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; diff --git a/src/mds/Migrator.h b/src/mds/Migrator.h index 5f0e93f442e64..ff399d3beacde 100644 --- a/src/mds/Migrator.h +++ b/src/mds/Migrator.h @@ -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 -- 2.39.5