]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
RGW - POSIXDriver - Cleanup vstart
authorDaniel Gryniewicz <dang@fprintf.net>
Thu, 18 Sep 2025 16:22:21 +0000 (12:22 -0400)
committerDaniel Gryniewicz <dang@fprintf.net>
Thu, 18 Sep 2025 16:28:11 +0000 (12:28 -0400)
- Disentangle POSIX from DBStore config in vstart
- Give POSIX it's own config for userdb location

Signed-off-by: Daniel Gryniewicz <dang@fprintf.net>
src/common/options/rgw.yaml.in
src/rgw/driver/posix/rgw_sal_posix.h
src/vstart.sh

index 6ab18332f5ff82fa8c3a2ecf60725501fc6aef7c..8482792be51a949635434913dd2b44528ccd46c0 100644 (file)
@@ -4124,6 +4124,13 @@ options:
   default: /tmp/rgw_posix_driver
   services:
   - rgw
+- name: rgw_posix_userdb_dir
+  type: str
+  level: advanced
+  desc: path for the directory for storing the User db
+  default: /var/lib/ceph/radosgw
+  services:
+  - rgw
 - name: rgw_posix_database_root
   type: str
   level: advanced
index fe664574d2d1b6cc9207aa3cfe60e56b710e6a44..3be73187ca6efbc4df0967b8842a0233f0d7b29d 100644 (file)
@@ -481,7 +481,7 @@ public:
   POSIXDriver(CephContext *_cct) : StoreDriver(), cct(_cct), zone(this)
   {
     const static std::string tenant = "default_ns";
-    const auto& db_path = g_conf().get_val<std::string>("dbstore_db_dir");
+    const auto& db_path = g_conf().get_val<std::string>("rgw_posix_userdb_dir");
     const auto& db_name = g_conf().get_val<std::string>("dbstore_db_name_prefix") + "-" + tenant;
     auto db_full_path = std::filesystem::path(db_path) / db_name;
     
index 5f2839f033ac74c20a85020b8b5f1a7ac10a7c3b..b4738dff183e0c61104f7105cec810809ce5d868 100755 (executable)
@@ -796,26 +796,6 @@ done
 
 }
 
-do_rgw_dbstore_conf() {
-    if [ $CEPH_NUM_RGW -gt 1 ]; then
-        echo "dbstore is not distributed so only works with CEPH_NUM_RGW=1"
-        exit 1
-    fi
-
-    if [ "$new" -eq 1 ]; then
-        prun rm -rf "$CEPH_DEV_DIR/rgw/dbstore"
-    fi
-
-    prun mkdir -p "$CEPH_DEV_DIR/rgw/dbstore"
-    wconf <<EOF
-        rgw backend store = dbstore
-        rgw config store = dbstore
-        dbstore db dir = $CEPH_DEV_DIR/rgw/dbstore
-        dbstore_config_uri = file://$CEPH_DEV_DIR/rgw/dbstore/config.db
-
-EOF
-}
-
 format_conf() {
     local opts=$1
     local indent="        "
@@ -982,22 +962,48 @@ $CCLIENTDEBUG
         ; rgw lc debug interval = 10
         $(format_conf "${extra_conf}")
 EOF
-    #if [ "$rgw_store" == "dbstore" ] ; then
-        #do_rgw_dbstore_conf
+    if [ "$rgw_store" == "dbstore" ] ; then
+        if [ $CEPH_NUM_RGW -gt 1 ]; then
+            echo "dbstore is not distributed so only works with CEPH_NUM_RGW=1"
+            exit 1
+        fi
+
+        if [ "$new" -eq 1 ]; then
+            prun rm -rf "$CEPH_DEV_DIR/rgw/dbstore"
+        fi
+
+        prun mkdir -p "$CEPH_DEV_DIR/rgw/dbstore"
+        wconf <<EOF
+        rgw backend store = dbstore
+        rgw config store = dbstore
+        dbstore db dir = $CEPH_DEV_DIR/rgw/dbstore
+        dbstore_config_uri = file://$CEPH_DEV_DIR/rgw/dbstore/config.db
+
+EOF
+    fi
     if [ "$rgw_store" == "posix" ] ; then
         # use dbstore as the backend and posix as the filter
-        do_rgw_dbstore_conf
         posix_dir="$CEPH_DEV_DIR/rgw/posix"
-        prun mkdir -p $posix_dir/root $posix_dir/lmdb
+        if [ "$new" -eq 1 ]; then
+            prun rm -rf "$posix_dir/root"
+            prun rm -rf "$posix_dir/lmdb"
+            prun rm -rf "$posix_dir/userdb"
+            prun rm -rf "$CEPH_DEV_DIR/rgw/dbstore/config.db"
+        fi
+
+        prun mkdir -p $posix_dir/root $posix_dir/lmdb $posix_dir/userdb "$CEPH_DEV_DIR/rgw/dbstore"
         wconf <<EOF
         rgw backend store = posix
+        rgw config store = dbstore
+        dbstore_config_uri = file://$CEPH_DEV_DIR/rgw/dbstore/config.db
         rgw posix base path = $posix_dir/root
+        rgw posix userdb dir = $posix_dir/userdb
         rgw posix database root = $posix_dir/lmdb
 
 EOF
     fi
-       do_rgw_conf
-       wconf << EOF
+    do_rgw_conf
+    wconf << EOF
 [mds]
 $CMDSDEBUG
 $DAEMONOPTS