From: Yan, Zheng Date: Thu, 10 Apr 2014 08:03:51 +0000 (+0800) Subject: mds: guarantee message ordering when importing non-auth caps X-Git-Tag: v0.80-rc1~60^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=02048dcc30e2c0d8a99ae98be98a8c13d45151c2;p=ceph.git mds: guarantee message ordering when importing non-auth caps Current code allow importing non-auth caps when inode is being exported. This can breaks message ordering because the corresponding cap import messages are sent after the flush session messages. So they can arrive at clients after clients have already received cap import messages from new auth MDS of the inode. The quick fix is ignore MExportCaps when inode is frozen. Signed-off-by: Yan, Zheng --- diff --git a/src/mds/Migrator.cc b/src/mds/Migrator.cc index 9f0e3d8bc430..84c0a0e3d29f 100644 --- a/src/mds/Migrator.cc +++ b/src/mds/Migrator.cc @@ -2993,10 +2993,10 @@ void Migrator::handle_export_caps(MExportCaps *ex) assert(in); assert(in->is_auth()); - /* - * note: i may be frozen, but i won't have been encoded for export (yet)! - * see export_go() vs export_go_synced(). - */ + + // FIXME + if (in->is_frozen()) + return; C_M_LoggedImportCaps *finish = new C_M_LoggedImportCaps(this, in, ex->get_source().num()); finish->client_map = ex->client_map; @@ -3026,6 +3026,8 @@ void Migrator::logged_import_caps(CInode *in, map& sseqmap) { dout(10) << "logged_import_caps on " << *in << dendl; + // see export_go() vs export_go_synced() + assert(in->is_auth()); // force open client sessions and finish cap import mds->server->finish_force_open_sessions(client_map, sseqmap);