Repository navigation
umbrella: pg_autoscaler: Fix divide by zero edge cases - #72345
Conversation
kamoltat
left a comment
There was a problem hiding this comment.
Need to remove the merge conflict stuff
| <<<<<<< HEAD | ||
| ======= |
There was a problem hiding this comment.
fixed merge conflict
| ceph osd pool rm data2 data2 --yes-i-really-really-mean-it | ||
| ceph osd pool rm data3 data3 --yes-i-really-really-mean-it | ||
| } | ||
| >>>>>>> 4c93663b181 (pg_autoscaler: Fix divide by zero edge cases) |
There was a problem hiding this comment.
fixed merge conflict
679baa6 to
fbf67cc
Compare
|
@Ericmzhang |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
fbf67cc to
d78cc1a
Compare
|
No need to run the whole rados suite, changes only touch the auto scaler which is a mgr module, not a big logical changes just a small edge case fix up. All Green |
|
In my opinion RADOS APPROVED |
-Fix divide by zero edge cases that occur when the pg target is zero (due to overlapping roots and small mon_target_pg_per_osd value where pg_target += mon_target_pg_per_osd // len(roots) = 0. Setting the reported ratio as 0 if calculating the ratio would cause a divide by zero -Return early for the case of bulk pools that have used_ratio > even_ratio and the remaining pg budget is 0 (leads to a divide by zero) Fixes: https://tracker.ceph.com/issues/81130 Signed-off-by: Eric Zhang <[email protected]> (cherry picked from commit 728153f) Conflicts: qa/workunits/mon/pg_autoscaler.sh src/pybind/mgr/pg_autoscaler/tests/test_overlapping_roots.py - Add new test cases for uncaught bug
d78cc1a to
ab19839
Compare
|
This PR has been added to umbrella integration testing by pdonnell started 2026-11-21-05:14. |
There was a problem hiding this comment.
Ceph Release Engineering Audit Report
Commit Parity Visualizer
| BACKPORT PR #72345 | SOURCE PR |
SOURCE STATUS |
|---|---|---|
| ab19839 pg_autoscaler: Fix divide by zero edge cases | PR #72321 | 728153f pg_autoscaler: Fix divide by zero edge cases |
Automated Backport Parity Review - Cherry-Pick Conflicts / Deviations
A conflict or deviation was detected during the simulation of this backport. The code in this PR does not match a clean cherry-pick of the upstream commits.
This does not necessarily indicate an issue but a maintainer should review.
**Click to expand conflict summaries.**
Deviation in Backport ab19839 (cherry-pick of 728153f)
Affected File(s)
qa/workunits/mon/pg_autoscaler.sh
Range Diff
Click to expand
--- Original (728153ff)
+++ Backport (ab19839d)
@@ -11,3 +11,10 @@
Fixes: https://tracker.ceph.com/issues/81130
Signed-off-by: Eric Zhang <[email protected]>
+(cherry picked from commit 728153ff3149e188fa92311d0173c69129b8453a)
+
+Conflicts:
+ qa/workunits/mon/pg_autoscaler.sh
+ src/pybind/mgr/pg_autoscaler/tests/test_overlapping_roots.py
+
+- Add new test cases for uncaught bug
================================================================================
RANGE DIFF
================================================================================
1: 728153ff314 ! 1: ab19839d7a1 pg_autoscaler: Fix divide by zero edge cases
@@ Commit message
Fixes: https://tracker.ceph.com/issues/81130
Signed-off-by: Eric Zhang <[email protected]>
+ (cherry picked from commit 728153ff3149e188fa92311d0173c69129b8453a)
+
+ Conflicts:
+ qa/workunits/mon/pg_autoscaler.sh
+ src/pybind/mgr/pg_autoscaler/tests/test_overlapping_roots.py
+
+ - Add new test cases for uncaught bug
## qa/workunits/mon/pg_autoscaler.sh ##
-@@
- #!/bin/bash -ex
-
- NUM_OSDS=$(ceph osd ls | wc -l)
--if [ $NUM_OSDS -lt 6]; then
-+if [ $NUM_OSDS -lt 6 ]; then
- echo "test requires at least 6 OSDs"
- exit 1
- fi
@@ qa/workunits/mon/pg_autoscaler.sh: EOF
- TARGET_PG_1=$(power2_floor $(( $MON_TARGET_PG_PER_OSD / $POOL_SIZE_1 )))
- TARGET_PG_2=$(power2_floor $(( ($NUM_OSDS - 3) * $MON_TARGET_PG_PER_OSD / $POOL_SIZE_2 )))
+ # -6 pg_target = 100
+ # -7: pg_target = 100
+
+- TARGET_PG_1=$(power2_floor $MON_TARGET_PG_PER_OSD)
+- TARGET_PG_2=$(power2_floor $(( ($NUM_OSDS - 3) * $MON_TARGET_PG_PER_OSD )))
++ POOL_SIZE_1=$(ceph osd pool get data0 size| grep -Eo '[0-9]{1,4}')
++ POOL_SIZE_2=$(ceph osd pool get data3 size| grep -Eo '[0-9]{1,4}')
+
++ TARGET_PG_1=$(power2_floor $(( $MON_TARGET_PG_PER_OSD / $POOL_SIZE_1 )))
++ TARGET_PG_2=$(power2_floor $(( ($NUM_OSDS - 3) * $MON_TARGET_PG_PER_OSD / $POOL_SIZE_2 )))
--
wait_for 300 "ceph osd pool get data0 pg_num | grep $TARGET_PG_1"
wait_for 300 "ceph osd pool get data1 pg_num | grep $TARGET_PG_1"
- wait_for 300 "ceph osd pool get data2 pg_num | grep $TARGET_PG_1"
@@ qa/workunits/mon/pg_autoscaler.sh: EOF
ceph osd pool rm data3 data3 --yes-i-really-really-mean-it
}
@@ qa/workunits/mon/pg_autoscaler.sh: EOF
@@ qa/workunits/mon/pg_autoscaler.sh: test_autoscaler_basic || return 1
test_pool_starvation || return 1
test_exact_budget || return 1
- test_overlapping_roots || return 1
-+test_pg_total_zero || return 1
+ test_overlapping_roots || exit 1
++test_pg_total_zero || exit 1
echo OK
-
+-
## src/pybind/mgr/pg_autoscaler/module.py ##
@@ src/pybind/mgr/pg_autoscaler/module.py: class PgAutoscaler(MgrModule):How to proceed:
- Authors (Genuine Conflicts): If this is a genuine conflict requiring manual resolution, ensure your resolution is correct. You must explain the conflict resolution in the commit message (e.g., leave the standard Git
Conflicts:block intact) and include an explanation for changes. - Authors (Need Help?): Reach out to the Component Lead for technical guidance on complex code conflicts.
- Component Leads (Review): Please review the Range Diff(s) above to verify the author's manual conflict resolution is correct for this release branch. If the deviation is intentional, documented, and approved then the component lead or @ceph/ceph-release-manager can bypass this check by commenting
/audit override.
Be familiar with the rules and guidelines for writing backports.
🛟 Need Help?
If you need technical help resolving these issues, please consult with the Component Lead. If you need administrative overrides, please see the #ceph-upstream-releases channel on Slack and request a review from the @ceph/ceph-release-manager.
📋 Component Lead / Release Manager
To override the audit failure, apply releng-audit-override label or comment /audit override.
When you are ready for a new audit, please remove the releng-audit-fail label or comment /audit retest.
|
jenkins test api |
|
jenkins test windows |
|
✅ Audit Override Applied by @batrick. |
|
This PR has been added to umbrella integration testing by pdonnell started 2026-11-25-20:01. |
|
All mon/pg_autoscaler.sh tests passed. Merging. |
backport tracker: https://tracker.ceph.com/issues/81362
backport of #72321
parent tracker: https://tracker.ceph.com/issues/81130
this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh