2020-08-28 18:35:03 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# Copyright (C) 2020 Red Hat <contact@redhat.com>
|
|
|
|
#
|
|
|
|
# Author: David Zafman <dzafman@redhat.com>
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU Library Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2, or (at your option)
|
|
|
|
# any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU Library Public License for more details.
|
|
|
|
#
|
|
|
|
source $CEPH_ROOT/qa/standalone/ceph-helpers.sh
|
|
|
|
|
|
|
|
function run() {
|
|
|
|
local dir=$1
|
|
|
|
shift
|
|
|
|
|
|
|
|
export CEPH_MON_A="127.0.0.1:7165" # git grep '\<7165\>' : there must be only one
|
|
|
|
export CEPH_MON_B="127.0.0.1:7166" # git grep '\<7166\>' : there must be only one
|
|
|
|
export CEPH_ARGS
|
|
|
|
CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none "
|
|
|
|
CEPH_ARGS+="--mon-host=$CEPH_MON "
|
|
|
|
CEPH_ARGS+="--mon_health_to_clog_tick_interval=1.0 "
|
|
|
|
export ORIG_CEPH_ARGS="$CEPH_ARGS"
|
|
|
|
|
|
|
|
local funcs=${@:-$(set | ${SED} -n -e 's/^\(TEST_[0-9a-z_]*\) .*/\1/p')}
|
|
|
|
for func in $funcs ; do
|
|
|
|
setup $dir || return 1
|
|
|
|
$func $dir || return 1
|
|
|
|
teardown $dir || return 1
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-11-12 23:51:49 +00:00
|
|
|
function wait_for_health_string() {
|
|
|
|
local grep_string=$1
|
2021-07-05 06:20:04 +00:00
|
|
|
local seconds=${2:-20}
|
2020-11-12 23:51:49 +00:00
|
|
|
|
|
|
|
# Allow mon to notice version difference
|
|
|
|
set -o pipefail
|
|
|
|
PASSED="false"
|
|
|
|
for ((i=0; i < $seconds; i++)); do
|
|
|
|
if ceph health | grep -q "$grep_string"
|
|
|
|
then
|
|
|
|
PASSED="true"
|
|
|
|
break
|
|
|
|
fi
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
set +o pipefail
|
|
|
|
|
|
|
|
# Make sure health changed
|
|
|
|
if [ $PASSED = "false" ];
|
|
|
|
then
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# Test a single OSD with an old version and multiple OSDs with 2 different old versions
|
2020-08-28 18:35:03 +00:00
|
|
|
function TEST_check_version_health_1() {
|
|
|
|
local dir=$1
|
|
|
|
|
|
|
|
# Asssume MON_A is leader?
|
|
|
|
CEPH_ARGS="$ORIG_CEPH_ARGS --mon-host=$CEPH_MON_A "
|
|
|
|
# setup
|
|
|
|
setup $dir || return 1
|
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# create a cluster with two monitors and three osds
|
2020-12-10 08:27:56 +00:00
|
|
|
run_mon $dir a --public-addr=$CEPH_MON_A --mon_warn_older_version_delay=0 || return 1
|
|
|
|
run_mon $dir b --public-addr=$CEPH_MON_B --mon_warn_older_version_delay=0 || return 1
|
2020-08-28 18:35:03 +00:00
|
|
|
run_osd $dir 0 || return 1
|
|
|
|
run_osd $dir 1 || return 1
|
|
|
|
run_osd $dir 2 || return 1
|
|
|
|
|
|
|
|
sleep 5
|
|
|
|
ceph health detail
|
|
|
|
# should not see this yet
|
|
|
|
ceph health detail | grep DAEMON_OLD_VERSION && return 1
|
|
|
|
|
|
|
|
kill_daemons $dir KILL osd.1
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test activate_osd $dir 1
|
2020-11-12 23:51:49 +00:00
|
|
|
|
|
|
|
wait_for_health_string "HEALTH_WARN .*There is a daemon running an older version of ceph" || return 1
|
2020-08-28 18:35:03 +00:00
|
|
|
|
|
|
|
ceph health detail
|
|
|
|
# Should notice that osd.1 is a different version
|
|
|
|
ceph health detail | grep -q "HEALTH_WARN .*There is a daemon running an older version of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "^[[]WRN[]] DAEMON_OLD_VERSION: There is a daemon running an older version of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "osd.1 is running an older version of ceph: 01.00.00-gversion-test" || return 1
|
|
|
|
|
|
|
|
kill_daemons $dir KILL osd.2
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test activate_osd $dir 2
|
2020-08-28 18:35:03 +00:00
|
|
|
kill_daemons $dir KILL osd.0
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=02.00.00-gversion-test activate_osd $dir 0
|
2020-11-12 23:51:49 +00:00
|
|
|
|
|
|
|
wait_for_health_string "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
2020-08-28 18:35:03 +00:00
|
|
|
|
|
|
|
ceph health detail
|
|
|
|
ceph health detail | grep -q "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "^[[]ERR[]] DAEMON_OLD_VERSION: There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "osd.1 osd.2 are running an older version of ceph: 01.00.00-gversion-test" || return 1
|
|
|
|
ceph health detail | grep -q "osd.0 is running an older version of ceph: 02.00.00-gversion-test" || return 1
|
|
|
|
}
|
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# Test with 1 MON and 1 MDS with an older version, and add 2 OSDs with different versions
|
2020-08-28 18:35:03 +00:00
|
|
|
function TEST_check_version_health_2() {
|
|
|
|
local dir=$1
|
|
|
|
|
|
|
|
# Asssume MON_A is leader?
|
|
|
|
CEPH_ARGS="$ORIG_CEPH_ARGS --mon-host=$CEPH_MON_A "
|
|
|
|
# setup
|
|
|
|
setup $dir || return 1
|
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# create a cluster with all daemon types
|
2020-12-10 08:27:56 +00:00
|
|
|
run_mon $dir a --public-addr=$CEPH_MON_A --mon_warn_older_version_delay=0 || return 1
|
|
|
|
run_mon $dir b --public-addr=$CEPH_MON_B --mon_warn_older_version_delay=0 || return 1
|
2020-08-28 18:35:03 +00:00
|
|
|
run_osd $dir 0 || return 1
|
|
|
|
run_osd $dir 1 || return 1
|
|
|
|
run_osd $dir 2 || return 1
|
|
|
|
run_mgr $dir x || return 1
|
|
|
|
run_mgr $dir y || return 1
|
|
|
|
run_mds $dir m || return 1
|
|
|
|
run_mds $dir n || return 1
|
|
|
|
|
|
|
|
sleep 5
|
|
|
|
ceph health detail
|
|
|
|
# should not see this yet
|
|
|
|
ceph health detail | grep DAEMON_OLD_VERSION && return 1
|
|
|
|
|
|
|
|
kill_daemons $dir KILL mon.b
|
2020-12-10 08:27:56 +00:00
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test run_mon $dir b --mon_warn_older_version_delay=0
|
2020-08-28 18:35:03 +00:00
|
|
|
# XXX: Manager doesn't seem to use the test specific config for version
|
|
|
|
#kill_daemons $dir KILL mgr.x
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
#ceph_debug_version_for_testing=02.00.00-gversion-test run_mgr $dir x
|
2020-08-28 18:35:03 +00:00
|
|
|
kill_daemons $dir KILL mds.m
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test run_mds $dir m
|
2020-11-12 23:51:49 +00:00
|
|
|
|
|
|
|
wait_for_health_string "HEALTH_WARN .*There are daemons running an older version of ceph" || return 1
|
2020-08-28 18:35:03 +00:00
|
|
|
|
|
|
|
ceph health detail
|
|
|
|
# Should notice that mon.b and mds.m is a different version
|
|
|
|
ceph health detail | grep -q "HEALTH_WARN .*There are daemons running an older version of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "^[[]WRN[]] DAEMON_OLD_VERSION: There are daemons running an older version of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "mon.b mds.m are running an older version of ceph: 01.00.00-gversion-test" || return 1
|
|
|
|
|
|
|
|
kill_daemons $dir KILL osd.2
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test activate_osd $dir 2
|
2020-08-28 18:35:03 +00:00
|
|
|
kill_daemons $dir KILL osd.0
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=02.00.00-gversion-test activate_osd $dir 0
|
2020-11-12 23:51:49 +00:00
|
|
|
|
|
|
|
wait_for_health_string "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
2020-08-28 18:35:03 +00:00
|
|
|
|
|
|
|
ceph health detail
|
|
|
|
ceph health | grep -q "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "^[[]ERR[]] DAEMON_OLD_VERSION: There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "mon.b osd.2 mds.m are running an older version of ceph: 01.00.00-gversion-test" || return 1
|
|
|
|
ceph health detail | grep -q "osd.0 is running an older version of ceph: 02.00.00-gversion-test" || return 1
|
|
|
|
}
|
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# Verify delay handling with same setup as test 1
|
2020-11-08 17:07:04 +00:00
|
|
|
function TEST_check_version_health_3() {
|
|
|
|
local dir=$1
|
|
|
|
|
|
|
|
# Asssume MON_A is leader?
|
|
|
|
CEPH_ARGS="$ORIG_CEPH_ARGS --mon-host=$CEPH_MON_A "
|
|
|
|
# setup
|
|
|
|
setup $dir || return 1
|
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# create a cluster with two monitors and three osds
|
2020-12-11 04:31:43 +00:00
|
|
|
run_mon $dir a --public-addr=$CEPH_MON_A || return 1
|
|
|
|
run_mon $dir b --public-addr=$CEPH_MON_B || return 1
|
|
|
|
|
|
|
|
local start_osd_time=$SECONDS
|
|
|
|
# use memstore for faster bootup
|
|
|
|
EXTRA_OPTS=" --osd-objectstore=memstore" run_osd $dir 0 || return 1
|
|
|
|
EXTRA_OPTS=" --osd-objectstore=memstore" run_osd $dir 1 || return 1
|
|
|
|
EXTRA_OPTS=" --osd-objectstore=memstore" run_osd $dir 2 || return 1
|
|
|
|
# take the time used for boot osds into consideration
|
|
|
|
local warn_older_version_delay=$(($SECONDS - $start_osd_time + 20))
|
2020-11-08 17:07:04 +00:00
|
|
|
|
|
|
|
sleep 5
|
|
|
|
ceph health detail
|
|
|
|
# should not see this yet
|
|
|
|
ceph health detail | grep DAEMON_OLD_VERSION && return 1
|
2020-12-11 04:31:43 +00:00
|
|
|
ceph tell 'mon.*' injectargs "--mon_warn_older_version_delay $warn_older_version_delay"
|
2020-11-08 17:07:04 +00:00
|
|
|
kill_daemons $dir KILL osd.1
|
2020-12-11 04:31:43 +00:00
|
|
|
EXTRA_OPTS=" --osd-objectstore=memstore" \
|
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test \
|
|
|
|
activate_osd $dir 1
|
2020-11-08 17:07:04 +00:00
|
|
|
|
2020-11-11 22:00:24 +00:00
|
|
|
# Wait 50% of 20 second delay config
|
2020-11-08 17:07:04 +00:00
|
|
|
sleep 10
|
|
|
|
# should not see this yet
|
|
|
|
ceph health detail | grep DAEMON_OLD_VERSION && return 1
|
|
|
|
|
|
|
|
# Now make sure that at least 20 seconds have passed
|
2020-11-12 23:51:49 +00:00
|
|
|
wait_for_health_string "HEALTH_WARN .*There is a daemon running an older version of ceph" 20 || return 1
|
2020-11-08 17:07:04 +00:00
|
|
|
|
|
|
|
ceph health detail
|
|
|
|
# Should notice that osd.1 is a different version
|
|
|
|
ceph health detail | grep -q "HEALTH_WARN .*There is a daemon running an older version of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "^[[]WRN[]] DAEMON_OLD_VERSION: There is a daemon running an older version of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "osd.1 is running an older version of ceph: 01.00.00-gversion-test" || return 1
|
|
|
|
|
|
|
|
kill_daemons $dir KILL osd.2
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=01.00.00-gversion-test activate_osd $dir 2
|
2020-11-08 17:07:04 +00:00
|
|
|
kill_daemons $dir KILL osd.0
|
src/*: do not pass cct to ceph_version_to_str()
in e5b1ae5554c4d8a20f9f0ff562b231ad0b0ba0ab, a new option named
"debug_version_for_testing" is introduced to override the version so
we can test version check.
in crimson, we have two families of shared functions.
- one of them is used by alien store. they are compiled with
-DWITH_SEASTAR and -DWITH_ALIEN, to enable the shim code between
seastar and POSIX thread.
- another is used by crimson in general. where no lock is allowed.
currently, we use the "crimson" and "ceph" namespace to differentiate
these two families of functions, so they can colocate in the same
executable without violating the ODR. see src/include/common_fwd.h for
more details.
the functions defined in src/common/version.cc are also shared by
alien store and crimson code. and because we have different
implementations of `CephContext` in crimson and in classic OSD (i.e.
alienstore), we have to have different implementations of this function
as well, if we follow the same approach. but since these functions are
very simple and are non-blocking, there is not much value in
differentiating them, it is better to inject the test settings using
environment variable instead of using ceph option subsystem.
in this change, "ceph_debug_version_for_testing" environment variable is
checked instead, so that crimson and alienstore can share the same
compilation unit of version.cc. and "debug_version_for_testing" option
is removed.
Signed-off-by: Kefu Chai <kchai@redhat.com>
2020-12-10 06:17:07 +00:00
|
|
|
ceph_debug_version_for_testing=02.00.00-gversion-test activate_osd $dir 0
|
2020-11-12 23:51:49 +00:00
|
|
|
|
|
|
|
wait_for_health_string "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
2020-11-08 17:07:04 +00:00
|
|
|
|
|
|
|
ceph health detail
|
|
|
|
ceph health detail | grep -q "HEALTH_ERR .*There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "^[[]ERR[]] DAEMON_OLD_VERSION: There are daemons running multiple old versions of ceph" || return 1
|
|
|
|
ceph health detail | grep -q "osd.1 osd.2 are running an older version of ceph: 01.00.00-gversion-test" || return 1
|
|
|
|
ceph health detail | grep -q "osd.0 is running an older version of ceph: 02.00.00-gversion-test" || return 1
|
|
|
|
}
|
|
|
|
|
2020-08-28 18:35:03 +00:00
|
|
|
main ver-health "$@"
|
2020-11-11 22:00:24 +00:00
|
|
|
|
|
|
|
# Local Variables:
|
|
|
|
# compile-command: "cd ../.. ; make -j4 && ../qa/run-standalone.sh ver-health.sh"
|
|
|
|
# End:
|