]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon: OSDMonitor: do not assume a session exists in send_incremental() 7150/head
authorJoao Eduardo Luis <joao@suse.de>
Thu, 7 Jan 2016 19:20:47 +0000 (19:20 +0000)
committerJoao Eduardo Luis <joao@suse.de>
Fri, 8 Jan 2016 00:05:42 +0000 (00:05 +0000)
commit5264bc677f0f612165987bf51fe7d7b4af32fa77
treebe4d55db86401c1bdb0b8f3bd6790722eae4f082
parent9739d4de49f8167866eda556b2f1581c068ec8a7
mon: OSDMonitor: do not assume a session exists in send_incremental()

We may not have an open session for a given osd. If we blindly assume we
do, we may end up trying to send incrementals we do not have to the osd.

And then we will crash.

This fixes a regression introduced by

  171fee1b82d2675e364da7f96dfb9dd286d9b6e6

which is meant as a backport of

  de43a02e06650a552f048dc8acd17f255126fed9

but so happens to intruduce a line that wasn't on the original patch. We
imagine it was meant to make the 's->osd_epoch' assignment work without
checking the session, as per the original patch, but the backporter must
have forgotten to also backport the assertion on the not-null session.
The unfortunate introduction of the check for a not-null session
triggered this regression.

The regression itself is due to enforcing that a session exists for the
osd we are sending the incrementals to. However, if we come via the
OSDMonitor::process_failures() path, that may very well not be the case,
as we are handling potentially-old MOSDFailure messages that may no
longer have an associated session. By enforcing the not-null session, we
don't check whether we have the requested versions (i.e., if
our_earliest_version <= requested_version), and thus we end up on the
path that assumes that we DO HAVE all the necessary versions -- when we
may not, thus finally asserting because we are reading blank
incremental versions.

Fixes: #14236
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/OSDMonitor.cc