From: Igor Fedotov Date: Tue, 21 Apr 2026 12:22:43 +0000 (+0300) Subject: qa/osd-bluefs-volume-ops: add more bluestore expansion test cases. X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f88927d283b08df6f1a13c547ef693ab074a6e59;p=ceph.git qa/osd-bluefs-volume-ops: add more bluestore expansion test cases. Reproduces: https://tracker.ceph.com/issues/75852 Signed-off-by: Igor Fedotov --- diff --git a/qa/standalone/osd/osd-bluefs-volume-ops.sh b/qa/standalone/osd/osd-bluefs-volume-ops.sh index 8f4f14cf14a..05242c20b5f 100755 --- a/qa/standalone/osd/osd-bluefs-volume-ops.sh +++ b/qa/standalone/osd/osd-bluefs-volume-ops.sh @@ -338,6 +338,8 @@ function TEST_bluestore() { timeout 60 rados bench -p foo 15 write -b 4096 --no-cleanup #|| return 1 wait_for_clean || return 1 + echo PASSED + return 0 } function TEST_bluestore2() { @@ -401,6 +403,9 @@ function TEST_bluestore2() { osd_pid0=$(cat $dir/osd.0.pid) wait_for_clean || return 1 + + echo PASSED + return 0 } function TEST_bluestore_expand() { @@ -485,15 +490,14 @@ function TEST_bluestore_expand() { ceph osd down 0 ceph-bluestore-tool --log-file $dir/bluestore_tool.log --path $dir/0 qfsck || return 1 + + echo PASSED + return 0 } function TEST_bluestore_expand_online() { local dir=$1 - local flimit=$(ulimit -n) - if [ $flimit -lt 1536 ]; then - echo "Low open file limit ($flimit), test may fail. Increase to 1536 or higher and retry if that happens." - fi export CEPH_MON="127.0.0.1:7146" # git grep '\<7146\>' : there must be only one export CEPH_ARGS CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none " @@ -571,9 +575,89 @@ function TEST_bluestore_expand_online() { ceph-bluestore-tool --path $dir/1 fsck || return 1 ceph-bluestore-tool --path $dir/2 fsck || return 1 ceph-bluestore-tool --path $dir/3 fsck || return 1 - } +function TEST_bluestore_expand_with_allocmap_recovery() { + local dir=$1 + + export CEPH_MON="127.0.0.1:7146" # git grep '\<7146\>' : there must be only one + export CEPH_ARGS + CEPH_ARGS+="--fsid=$(uuidgen) --auth-supported=none " + CEPH_ARGS+="--mon-host=$CEPH_MON " + CEPH_ARGS+="--bluestore_block_size=2G " + CEPH_ARGS+="--bluestore_block_db_create=true " + CEPH_ARGS+="--bluestore_block_db_size=1G " + CEPH_ARGS+="--bluestore_block_wal_size=1G " + CEPH_ARGS+="--bluestore_block_wal_create=true " + CEPH_ARGS+="--bluestore_fsck_on_mount=true " + CEPH_ARGS+="--osd_pool_default_size=1 " + CEPH_ARGS+="--osd_pool_default_min_size=1 " + CEPH_ARGS+="--bluestore_debug_enforce_settings=ssd " + CEPH_ARGS+="--bluestore_allocation_from_file=1 " + + run_mon $dir a || return 1 + run_mgr $dir x || return 1 + run_osd $dir 0 || return 1 + osd_pid0=$(cat $dir/osd.0.pid) + + run_osd $dir 1 || return 1 + osd_pid1=$(cat $dir/osd.1.pid) + + sleep 5 + + create_pool foo 16 + + # write some objects + timeout 60 rados bench -p foo 5 write -b 4096 --no-cleanup #|| return 1 + + echo "after bench" + + # kill OSD.0 non-gracefully + while kill -9 $osd_pid0; do sleep 1 ; done + ceph osd down 0 + + # kill OSD.1 [hopefully] gracefully + while kill $osd_pid1; do sleep 1 ; done + ceph osd down 1 + + available0=$( ceph-objectstore-tool --data-path $dir/0 --op statfs --no-mon-config --format json-pretty | jq ".available" ) + truncate $dir/0/block -s +2G # 4GB total + + ceph-bluestore-tool --path $dir/0 bluefs-bdev-expand || return 1 + + available=$( ceph-objectstore-tool --data-path $dir/0 --op statfs --no-mon-config --format json-pretty | jq ".available" ) + if [ $(($available-$available0)) -le $((1<<30)) ]; then + # Failed to get large enough available space increase + echo $available0 " -> " $available ", failed to expand?" + return 1 + fi + + available0=$( ceph-objectstore-tool --data-path $dir/1 --op statfs --no-mon-config --format json-pretty | jq ".available" ) + truncate $dir/1/block -s +2G # 4GB total + + ceph-bluestore-tool --path $dir/1 bluefs-bdev-expand || return 1 + + available=$( ceph-objectstore-tool --data-path $dir/1 --op statfs --no-mon-config --format json-pretty | jq ".available" ) + if [ $(($available-$available0)) -le $((1<<30)) ]; then + # Failed to get large enough available space increase + echo $available0 " -> " $available ", failed to expand?" + return 1 + fi + + ceph-bluestore-tool --path $dir/0 fsck || return 1 + ceph-bluestore-tool --path $dir/1 fsck || return 1 + + activate_osd $dir 0 || return 1 + osd_pid0=$(cat $dir/osd.0.pid) + + activate_osd $dir 1 || return 1 + osd_pid1=$(cat $dir/osd.1.pid) + + wait_for_clean || return 1 + + echo PASSED + return 0 +} main osd-bluefs-volume-ops "$@" # Local Variables: