We can have a sequence one the MDS like:
- queue REQUEST_CLOSE to journal
- force_open, queue open to journal
- request_close acked, do nothing
- force_open acked, send OPEN
In this case, the MDS never actually closed the session, and all of the
state remained valid. The client, however, gets a suprious OPEN
message and resets the session state.
Fix this by not resetting that state.
A nicer fix might be to not send the second OPEN at all, but that would
require a REOPENING state on the MDS which is more complicated; this is
good enough. Also, that approach might not give the client an
appropriate opportunity to say "um, no..." and resend the
REQUEST_CLOSE.
Signed-off-by: Sage Weil <sage@inktank.com>
switch (m->get_op()) {
case CEPH_SESSION_OPEN:
- if (!mds_session)
+ if (!mds_session) {
mds_sessions[from] = mds_session = new MetaSession();
- mds_session->mds_num = from;
- mds_session->seq = 0;
- mds_session->inst = m->get_source_inst();
+ mds_session->mds_num = from;
+ mds_session->seq = 0;
+ mds_session->inst = m->get_source_inst();
+ }
renew_caps(from);
if (unmounting) {
mds_session->closing = true;