From: Kefu Chai Date: Thu, 2 Jul 2026 05:48:38 +0000 (+0800) Subject: vstart.sh: only skip fs volume create when there's no mgr to run it X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bb9c1fde9f93e8f31d512dd13482da552b2ed52d;p=ceph.git vstart.sh: only skip fs volume create when there's no mgr to run it The mgr volumes module handles fs volume ls/create, not the monitor, so without a mgr (CEPH_NUM_MGR=0) the "wait for volume module to load" loop spun forever. Open-coding fs new unconditionally, my first attempt, changed pool creation for every vstart user and dropped the wait, so cephfs tests calling `fs volume ...` right after vstart.sh returns could race a module still mid-load. create_fs_volume() branches on CEPH_NUM_MGR instead. With a mgr it still calls fs volume ls/create. Without one it runs the plain mon commands fs volume create wraps: osd pool create cephfs..{meta,data}, then fs new . The wait stays at its one call site above the per-filesystem loop, so it runs once regardless of CEPH_NUM_FS, not once per filesystem. Verified against a local vstart: mgr present, fs volume ls polls once then creates CEPH_NUM_FS=2 filesystems with no repeated poll; CEPH_NUM_MGR=0, no poll, fs new creates 'a' directly, HEALTH_OK. Signed-off-by: Kefu Chai --- diff --git a/src/vstart.sh b/src/vstart.sh index 9e5e6cd3c68..c64c9cf9983 100755 --- a/src/vstart.sh +++ b/src/vstart.sh @@ -1482,6 +1482,19 @@ EOF fi } +create_fs_volume() { + local name=$1 + if [ "$CEPH_NUM_MGR" -gt 0 ]; then + ceph_adm fs volume create ${name} + else + local meta_pool="cephfs.${name}.meta" + local data_pool="cephfs.${name}.data" + ceph_adm osd pool create "$meta_pool" + ceph_adm osd pool create "$data_pool" --bulk + ceph_adm fs new ${name} "$meta_pool" "$data_pool" + fi +} + start_mds() { local mds=0 for name in a b c d e f g h i j k l m n o p @@ -1532,12 +1545,15 @@ EOF ceph_adm fs flag set enable_multiple true --yes-i-really-mean-it fi - # wait for volume module to load - while ! ceph_adm fs volume ls ; do sleep 1 ; done + if [ "$CEPH_NUM_MGR" -gt 0 ]; then + # wait for volume module to load + while ! ceph_adm fs volume ls ; do sleep 1 ; done + fi + local fs=0 for name in a b c d e f g h i j k l m n o p do - ceph_adm fs volume create ${name} + create_fs_volume ${name} ceph_adm fs authorize ${name} "client.fs_${name}" / rwp >> "$keyring_fn" fs=$(($fs + 1)) [ $fs -eq $CEPH_NUM_FS ] && break