Skip to content

Commit 224c7b6

Browse files
gmayyyhaidryomov
authored andcommitted
ceph: use frag's MDS in either mode
When doing some tests with multiple mds, we were seeing many mds forwarding requests between them, causing clients to resend. If the request is a modification operation and the mode is set to USE_AUTH_MDS, then the auth mds should be selected to handle the request. If auth mds for frag is already set, then it should be returned directly without further processing. The current logic is wrong because it only returns directly if mode is USE_AUTH_MDS, but we want to do that for all modes. If we don't, then when the frag's mds is not equal to cap session's mds, the request will get sent to the wrong MDS needlessly. Drop the mode check in this condition. Signed-off-by: Yanhu Cao <[email protected]> Reviewed-by: Jeff Layton <[email protected]> Signed-off-by: Ilya Dryomov <[email protected]>
1 parent a0102bd commit 224c7b6

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/ceph/mds_client.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,8 +1103,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc,
11031103
frag.frag, mds);
11041104
if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >=
11051105
CEPH_MDS_STATE_ACTIVE) {
1106-
if (mode == USE_ANY_MDS &&
1107-
!ceph_mdsmap_is_laggy(mdsc->mdsmap,
1106+
if (!ceph_mdsmap_is_laggy(mdsc->mdsmap,
11081107
mds))
11091108
goto out;
11101109
}

0 commit comments

Comments
 (0)