]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
update documentation on cache expires during exports
authorGreg Farnum <gregory.farnum@dreamhost.com>
Thu, 21 Jul 2011 22:27:24 +0000 (15:27 -0700)
committerGreg Farnum <gregory.farnum@dreamhost.com>
Fri, 22 Jul 2011 18:36:46 +0000 (11:36 -0700)
Add an assert to check conditions.

Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
src/doc/caching.txt
src/mds/MDCache.cc

index 161eaf7428a537dc0b873fcd0d969b271be4ad3d..31570cc874b390533883aa1c7c6b0fc1ba06fb4b 100644 (file)
@@ -193,12 +193,23 @@ range of resulting implementation complications relating metadata
 migration.
 
 
-CACHE EXPIRATION FOR FROZEN SUBTREES
+CACHE EXPIRATION FOR EXPORTING SUBTREES
 
 Cache expiration messages that are received for a subtree that is
-frozen are temporarily set aside instead of being processed.  Only
-when the subtree is unfrozen are the expirations either processed (if
-the MDS is authoritative) or discarded (if it is not).  Because either
+being exported are either deferred or handled immediately, based on
+the sender and reciever states. The importing MDS will always defer until
+after the export finishes, because the import could fail. The exporting MDS
+processes the expire UNLESS the expiring MDS does not know about the export or
+the exporting MDS is no longer auth.
+Because MDSes get witness notifications on export, this is safe. Either:
+a) The expiring MDS knows about the export, and has sent messages to both
+MDSes involved, or
+b) The expiring MDS did not know about the export at the time the message
+was sent, and so only sent it to the exporting MDS. (This implies that the
+exporting MDS hasn't yet encoded the state to send to the replica MDS.)
+
+When the subtree export completes, deferred expirations are either processed
+(if the MDS is authoritative) or discarded (if it is not).  Because either
 the exporting or importing metadata can fail during the migration
 process, the MDS cannot tell whether it will be authoritative or not
 until the process completes.
@@ -211,7 +222,6 @@ the event of a failure.
 
 
 
-
 NORMAL MIGRATION
 
 The exporter begins by doing some checks in export_dir() to verify
index 48ad1d450b69d5f6e7f68ec570d969036d9334a7..e2ee31941a57f66b0859fd6da187c3557b9d863a 100644 (file)
@@ -5747,6 +5747,7 @@ void MDCache::handle_cache_expire(MCacheExpire *m)
       
       if (!con->is_auth() ||
          (con->is_auth() && con->is_exporting() &&
+          // this person has acked that we're exporting
           migrator->get_export_state(con) == Migrator::EXPORT_WARNING &&
           migrator->export_has_warned(con,from))) {
        // not auth.
@@ -5761,6 +5762,10 @@ void MDCache::handle_cache_expire(MCacheExpire *m)
        delayed_expire[con][from]->add_realm(p->first, p->second);
        continue;
       }
+      assert(!(parent_dir->is_auth() && parent_dir->is_exporting()) ||
+             (migrator->get_export_state(parent_dir) == Migrator::EXPORT_WARNING &&
+                 !migrator->export_has_warned(parent_dir, from)));
+
       dout(7) << "expires for " << *con << dendl;
     } else {
       dout(7) << "containerless expires (root, stray inodes)" << dendl;