]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mds: flush session messages before exporting caps
authorYan, Zheng <zheng.z.yan@intel.com>
Fri, 25 Oct 2013 08:30:49 +0000 (16:30 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Mon, 16 Dec 2013 04:15:24 +0000 (12:15 +0800)
commitd00ec7915c0ae2e752cb14708795fd71e230a185
tree470aa13c51fa7b862f067bf01f22a74056d41fd5
parent77515b7a3c7280a2bd448889ea63591ad69096f0
mds: flush session messages before exporting caps

Following sequence of events can happen when exporting inodes:

- client sends open file request to mds.0
- mds.0 handles the request and sends inode stat back to the client
- mds.0 export the inode to mds.1
- mds.1 sends cap import message to the client
- mds.0 sends cap export message to the client
- client receives the cap import message from mds.1, but the client
  still doesn't have corresponding inode in the cache. So the client
  releases the imported caps.
- client receives the open file reply from mds.0
- client receives the cap export message from mds.0.

After the end of these events, the client doesn't have any cap for
the opened file.

To fix the message ordering issue, this patch introduces a new session
operation FLUSHMSG. Before exporting caps, we send a FLUSHMSG seesion
message to client and wait for the acknowledgment. When receiveing the
FLUSHMSG_ACK message from client, we are sure that clients have received
all messages sent previously.

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/common/ceph_strings.cc
src/include/ceph_fs.h
src/mds/Migrator.cc
src/mds/Migrator.h
src/mds/Server.cc
src/mds/Server.h
src/mds/SessionMap.h