]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mds: fix race in connection accept; fix con replacement
authorSage Weil <sage@inktank.com>
Tue, 10 Jul 2012 20:24:51 +0000 (13:24 -0700)
committerSage Weil <sage@inktank.com>
Wed, 11 Jul 2012 02:04:42 +0000 (19:04 -0700)
commita542d89ee592d08204ca6d4ba62d087aed1df0fc
treed9793e30f2552484752e2283d2b1fa700d845fe4
parent68bad03b2c5cfd6c670650258d60e04ee1dd3b93
mds: fix race in connection accept; fix con replacement

We solve two problems with this patch.  The first is that the messenger
will now reuse an existing session's Connection with a new connection,
which means that we don't want to change session->connection when we
are validating an authorizer.  Instead, set (but do not change) it.

We also want to avoid a race where:

 - mds recovers, replays Sessions with no con's
 - multiple connection attempts for the same session race in the msgr
 - both are authorized, but out of order
 - Session->connection gets set to the losing attempt's Connection*

Instead, we take advantage of an accept event that is called only for
accepted winners.

Signed-off-by: Sage Weil <sage@inktank.com>
fixup
src/mds/MDS.cc
src/mds/MDS.h