]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mon/MonClient: respect priority in SRV
authorKefu Chai <kchai@redhat.com>
Fri, 22 Mar 2019 11:32:32 +0000 (19:32 +0800)
committerKefu Chai <kchai@redhat.com>
Fri, 22 Mar 2019 14:10:26 +0000 (22:10 +0800)
commit77b45ebaaa3de2aaf90fbaf9c6e93469c3e21066
treece1c63d9623dc2c04df71771a8d1065e675a66c9
parent37d4390a27d08f90f1019ef188232da26262434d
mon/MonClient: respect priority in SRV

before this change, we always choose the monitors with the lowest
priority and ignore the ones with higher priorty. but per
https://www.ietf.org/rfc/rfc2782.txt

> A client MUST attempt to contact the target host with the
> lowest-numbered priority it can reach

so, if a monitor is not reachable, we should try the ones with the
lowest ones *reachable*.

after this change, MonClient will memorize the monitors have been
contacted. and will continue hunting the ones not tried if the last
batch fail.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MonClient.cc
src/mon/MonClient.h