]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon: MonMap: clear 'mon_info' during decode
authorJoao Eduardo Luis <joao@suse.de>
Wed, 21 Dec 2016 23:40:47 +0000 (23:40 +0000)
committerSage Weil <sage@redhat.com>
Thu, 22 Dec 2016 14:13:37 +0000 (09:13 -0500)
commit36ecfbd8bf022cc4ad71f5e3a15bd50814b86aeb
treeaf15b82bf1f778482a1f08f6d2bb21e0150bed83
parent3824ad3fec51f5de76eabe57df51c299434f43e5
mon: MonMap: clear 'mon_info' during decode

It so happens that it's not safe to assume the monmap will be in an
empty state upon decoding.

Turns out the MonClient will reuse the MonMap instance when decoding
the just received map from the monitors. Should the monitors be on an
older version that do not support 'mon_info', this field will not be
decoded (after all, there's no field to decode from); but by this time,
the MonClient would already have a built monmap, which could have
populated 'mon_info' with temporary mon names from 'mon initial
members'.

Given the existing entries in 'mon_info', and the conflicting entries in
'mon_addr', we would end up asserting in 'sanitize_mons()'. This becomes
a non-issue if 'mon_info' is empty, as was unfortunately presumed.

Fixes: http://tracker.ceph.com/issues/18265
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/MonMap.cc