]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/suites/crimson: Add a test for PG Splitting in the crimson suite 60428/head
authorAishwarya Mathuria <amathuri@redhat.com>
Tue, 11 Feb 2025 09:38:22 +0000 (09:38 +0000)
committerAishwarya Mathuria <amathuri@redhat.com>
Tue, 27 May 2025 08:00:00 +0000 (08:00 +0000)
Signed-off-by: Aishwarya Mathuria <amathuri@redhat.com>
qa/suites/crimson-rados/singleton/all/osd-pg-splitting.yaml [new file with mode: 0644]
qa/workunits/rados/test_pg_splitting.sh [new file with mode: 0755]

diff --git a/qa/suites/crimson-rados/singleton/all/osd-pg-splitting.yaml b/qa/suites/crimson-rados/singleton/all/osd-pg-splitting.yaml
new file mode 100644 (file)
index 0000000..9ae88f4
--- /dev/null
@@ -0,0 +1,38 @@
+roles:
+- - mon.a
+  - mon.b
+  - mon.c
+  - mgr.x
+  - osd.0
+  - osd.1
+  - osd.2
+  - client.0
+openstack:
+  - volumes: # attached to each instance
+      count: 3
+      size: 10 # GB
+tasks:
+- install:
+    flavor: crimson
+- ceph:
+    pre-mgr-commands:
+      - sudo ceph config set mgr mgr_pool false --force
+    log-ignorelist:
+      - but it is still running
+      - overall HEALTH_
+      - \(PG_
+    conf:
+      osd:
+        osd min pg log entries: 5
+        crimson alien thread cpu cores: 6-7
+      osd.0:
+        crimson seastar cpu cores: 0-1
+      osd.1:
+        crimson seastar cpu cores: 2-3
+      osd.2:
+        crimson seastar cpu cores: 4-5
+      global:
+- workunit:
+    clients:
+      client.0:
+        - rados/test_pg_splitting.sh
diff --git a/qa/workunits/rados/test_pg_splitting.sh b/qa/workunits/rados/test_pg_splitting.sh
new file mode 100755 (executable)
index 0000000..92fd009
--- /dev/null
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+. $(dirname $0)/../../standalone/ceph-helpers.sh
+
+set -x
+
+function test_pg_splitting() {
+    ceph osd pool delete foo foo --yes-i-really-really-mean-it || true
+    create_pool foo 4
+    wait_for_clean || return 1
+
+    #ensure nopgchange is set to 0 to allow for change in pg_num
+    ceph osd pool set foo nopgchange 0
+    #increase pg_num to induce splitting
+    ceph osd pool set foo pg_num 16
+    wait_for_clean || return 1
+    ceph osd pool set foo pgp_num 16
+    wait_for_clean || return 1
+
+    #get new PG stats
+    stats=$(ceph pg ls-by-pool foo --format=json 2>/dev/null | jq -r ".pg_stats")
+    new_pg_count=$(echo "$stats" | jq '. | length')
+    echo "New PG Count: $new_pg_count"
+    test "$new_pg_count" -eq 16 || return 1
+}
+
+test_pg_splitting || exit 1
+
+echo "OK"