Problem:
--mon-initial-members does nothing but causes monmap
to populate ``removed_ranks`` because the way we start
monitors in standalone tests uses ``run_mon $dir $id ..``
on each mon. Regardless of --mon-initial-members=a,b,c, if
we set --mon-host=$MONA,$MONB,$MONC (which we do every single tests),
everytime we run a monitor (e.g.,run mon.b) it will pre-build
our monmap with
```
noname-a=mon.noname-a addrs v2:127.0.0.1:7127/0,
b=mon.b addrs v2:127.0.0.1:7128/0,
noname-c=mon.noname-c addrs v2:127.0.0.1:7129/0,
```
Now, with --mon-initial-members=a,b,c we are letting
monmap know that we should have initial members name:
a,b,c, which we only have `b` as a match. So what
``MonMap::set_initial_members`` do is that it will
remove noname-a and noname-c which will
populate `removed_ranks`.
Solution:
remove all instances of --mon-initial-members
in the standalone test as it has no impact on
the nature of the tests themselves.
Fixes: https://tracker.ceph.com/issues/58132
Signed-off-by: Kamoltat <ksirivad@redhat.com>
(cherry picked from commit
e1c095dcf0a019bff01d2d8c819e5f95604c8da5)
setup $dir || return 1
- run_mon $dir a --mon-initial-members=a || return 1
+ run_mon $dir a || return 1
ceph mon dump | grep "mon.a" || return 1
kill_daemons $dir || return 1
MONC=127.0.0.1:7129 # git grep '\<7129\>' ; there must be only one
CEPH_ARGS_orig=$CEPH_ARGS
CEPH_ARGS="--fsid=$fsid --auth-supported=none "
- CEPH_ARGS+="--mon-initial-members=a,b,c "
CEPH_ARGS+="--mon-host=$MONA,$MONB,$MONC "
CEPH_ARGS+="--mon-debug-no-initial-persistent-features "
CEPH_ARGS+="--mon-debug-no-require-quincy "
# start the mon with a public-bind-addr that is different
# from the public-addr.
- CEPH_ARGS+="--mon-initial-members=a "
CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC} "
run_mon $dir a --mon-host=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
# start the mon with a public-bind-addr that is different
# from the public-addr.
- CEPH_ARGS+="--mon-initial-members=a "
CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC} "
run_mon $dir a --mon-host=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
# start the mon with a public-bind-addr that is different
# from the public-addr.
- CEPH_ARGS+="--mon-initial-members=a,b,c "
CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC},${MON_IP}:${MONB_PUBLIC},${MON_IP}:${MONC_PUBLIC} "
run_mon $dir a --public-addr=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
run_mon $dir b --public-addr=${MON_IP}:${MONB_PUBLIC} --public-bind-addr=${MON_IP}:${MONB_BIND} || return 1
# start the mon with a public-bind-addr that is different
# from the public-addr.
- CEPH_ARGS+="--mon-initial-members=a,b,c "
CEPH_ARGS+="--mon-host=${MON_IP}:${MONA_PUBLIC},${MON_IP}:${MONB_PUBLIC},${MON_IP}:${MONC_PUBLIC} "
run_mon $dir a --public-addr=${MON_IP}:${MONA_PUBLIC} --public-bind-addr=${MON_IP}:${MONA_BIND} || return 1
run_mon $dir b --public-addr=${MON_IP}:${MONB_PUBLIC} --public-bind-addr=${MON_IP}:${MONB_BIND} || return 1
FSID=$(uuidgen)
export CEPH_ARGS
CEPH_ARGS+="--fsid=$FSID --auth-supported=none "
- CEPH_ARGS+="--mon-initial-members=a,b --mon-host=$MONA,$MONB "
+ CEPH_ARGS+="--mon-host=$MONA,$MONB "
run_mon $dir a --public-addr $MONA || return 1
run_mon $dir b --public-addr $MONB || return 1
)