]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: handle fragment notify race
authorYan, Zheng <zyan@redhat.com>
Wed, 17 Oct 2018 03:07:53 +0000 (11:07 +0800)
committerYan, Zheng <zyan@redhat.com>
Thu, 17 Jan 2019 13:07:35 +0000 (21:07 +0800)
commitdf1e831f6118f19fd82be2724adda1c82a90d871
treec168dc22b1c6ab6070c7fa0802ff6a234110dba0
parent4aaeba39a91d649fc6a20d023f6827e2bb1f607f
mds: handle fragment notify race

In the nornal case, mds does not trim dir inode whose child dirfrags
are likely being fragmented (see trim_inode()). But when fragmenting
subtree roots, following race can happen:

- mds.a (auth mds of dirfrag) sends fragment_notify message to
  mds.c and drops wrlock on dirfragtreelock.
- mds.b (auth mds of dir inode) changes dirfragtreelock state to
  SYNC and send lock message mds.c
- mds.c receives the lock message and changes dirfragtreelock state
  to SYNC
- mds.c trim dirfrag and dir inode from its cache
- mds.c receives the fragment_notify message

The fix is asking replicas to ack fragment_notify message, unlocking
dirfragtreelock after mds gets all acks.

Fixes: http://tracker.ceph.com/issues/36035
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit 72887980a7d6517740a2841d6014a92a2d1c3063)

 Conflicts:
src/mds/MDCache.cc
src/mds/MDCache.h
src/mds/Locker.cc
src/messages/MMDSFragmentNotify.h
src/msg/Message.h
src/msg/Message.cc
src/mds/Locker.cc
src/mds/Locker.h
src/mds/MDCache.cc
src/mds/MDCache.h
src/messages/MMDSFragmentNotify.h
src/messages/MMDSFragmentNotifyAck.h [new file with mode: 0644]
src/msg/Message.cc
src/msg/Message.h