echo start osd.$id
ceph-osd -i $id $ceph_args &
+ # If noup is set, then can't wait for this osd
+ if ceph osd dump --format=json | jq '.flags_set[]' | grep -q '"noup"' ; then
+ return 0
+ fi
wait_for_osd up $id || return 1
}
-function run_osd_bluestore() {
+function run_osd_filestore() {
local dir=$1
shift
local id=$1
echo "{\"cephx_secret\": \"$OSD_SECRET\"}" > $osd_data/new.json
ceph osd new $uuid -i $osd_data/new.json
rm $osd_data/new.json
- ceph-osd -i $id $ceph_args --mkfs --key $OSD_SECRET --osd-uuid $uuid --osd-objectstore=bluestore
+ ceph-osd -i $id $ceph_args --mkfs --key $OSD_SECRET --osd-uuid $uuid --osd-objectstore=filestore
local key_fn=$osd_data/keyring
cat > $key_fn<<EOF
echo start osd.$id
ceph-osd -i $id $ceph_args &
+ # If noup is set, then can't wait for this osd
+ if ceph osd dump --format=json | jq '.flags_set[]' | grep -q '"noup"' ; then
+ return 0
+ fi
wait_for_osd up $id || return 1
[ "$id" = "$(cat $osd_data/whoami)" ] || return 1
+ # If noup is set, then can't wait for this osd
+ if ceph osd dump --format=json | jq '.flags_set[]' | grep -q '"noup"' ; then
+ return 0
+ fi
wait_for_osd up $id || return 1
}
shift
local osd_data=$dir/$id
- local journal_args
- if [ "$objectstore_type" == "filestore" ]; then
- journal_args=" --journal-path $osd_data/journal"
- fi
ceph-objectstore-tool \
--data-path $osd_data \
- $journal_args \
"$@" || return 1
}
local dir=$1
setup $dir || return 1
- run_mon $dir a --osd_pool_default_size=1 --osd_failsafe_full_ratio=.99 --mon_pg_warn_min_per_osd=0 || return 1
+ run_mon $dir a --osd_failsafe_full_ratio=.99 --mon_pg_warn_min_per_osd=0 || return 1
run_mgr $dir x --mon_pg_warn_min_per_osd=0 || return 1
+ # start osd_pool_default_size OSDs
run_osd $dir 0 || return 1
+ run_osd $dir 1 || return 1
+ run_osd $dir 2 || return 1
kill_daemons $dir TERM osd || return 1
ceph osd down 0 || return 1
+ # expect TOO_FEW_OSDS warning
! TIMEOUT=1 wait_for_health_ok || return 1
+ # resurrect all OSDs
activate_osd $dir 0 || return 1
+ activate_osd $dir 1 || return 1
+ activate_osd $dir 2 || return 1
wait_for_health_ok || return 1
teardown $dir || return 1
}
if [ "$pooltype" != "ec" ]; then
shard_id=""
fi
- set_config osd $osd_id filestore_debug_inject_read_err true || return 1
+ type=$(cat $dir/$osd_id/type)
+ set_config osd $osd_id ${type}_debug_inject_read_err true || return 1
local loop=0
while ( CEPH_ARGS='' ceph --admin-daemon $(get_asok_path osd.$osd_id) \
inject${which}err $poolname $objname $shard_id | grep -q Invalid ); do
fi
}
+function create_ec_pool() {
+ local pool_name=$1
+ shift
+ local allow_overwrites=$1
+ shift
+
+ ceph osd erasure-code-profile set myprofile crush-failure-domain=osd "$@" || return 1
+
+ create_pool "$poolname" 1 1 erasure myprofile || return 1
+
+ if [ "$allow_overwrites" = "true" ]; then
+ ceph osd pool set "$poolname" allow_ec_overwrites true || return 1
+ fi
+
+ wait_for_clean || return 1
+ return 0
+}
+
# Local Variables:
# compile-command: "cd ../../src ; make -j4 && ../qa/standalone/ceph-helpers.sh TESTS # test_get_config"
# End: