]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix handling of cache_expire export
authorSage Weil <sage@inktank.com>
Sun, 21 Oct 2012 21:22:51 +0000 (14:22 -0700)
committerSage Weil <sage@inktank.com>
Fri, 26 Oct 2012 03:49:04 +0000 (20:49 -0700)
During export, between the warning stage and the final notify, we may
get cache expire messages because the replicas are sending to both us
and the new auth.  This check should look for >= WARNING so that it
includes the EXPORTING states as well as the portion of WARNING after
we heard from that replica.  This aligns the conditional with the
following assert such that they are properly mutually exclusive.

Fixes: #1527
Signed-off-by: Sage Weil <sage@inktank.com>
src/mds/MDCache.cc

index 8598f46dba57c93839934d17cf5b6062473489b7..00a21586bac638a1173f8a257b8adb0a8c4bf661 100644 (file)
@@ -5913,14 +5913,14 @@ void MDCache::handle_cache_expire(MCacheExpire *m)
       
       if (!parent_dir->is_auth() ||
          (parent_dir->is_auth() && parent_dir->is_exporting() &&
-          // this person has acked that we're exporting
-          migrator->get_export_state(parent_dir) == Migrator::EXPORT_WARNING &&
-          migrator->export_has_warned(parent_dir,from))) {
+          ((migrator->get_export_state(parent_dir) == Migrator::EXPORT_WARNING &&
+            migrator->export_has_warned(parent_dir,from)) ||
+           migrator->get_export_state(parent_dir) == Migrator::EXPORT_EXPORTING))) {
        // not auth.
        dout(7) << "delaying nonauth|warned expires for " << *parent_dir << dendl;
        assert(parent_dir->is_frozen_tree_root());
        
-       // make a message parent_dirtainer
+       // make a message container
        if (delayed_expire[parent_dir].count(from) == 0)
          delayed_expire[parent_dir][from] = new MCacheExpire(from);