Bug #27000
mgr balancer does not save optimized plan but latest
100%
Description
The current balancer module fails to deepcopy the optimized plan so that best_ws and best_ow are modified later.
Example log which might explain everything:
It fixes the following (mgr debug output):
2018-08-20 22:33:46.078525 7f2fbc3b6700 0 mgr[balancer] Step result
score 0.001152 -> 0.001180, misplacing 0.000912
2018-08-20 22:33:46.078574 7f2fbc3b6700 0 mgr[balancer] Score got
worse, taking another step
2018-08-20 22:33:46.078770 7f2fbc3b6700 0 mgr[balancer] Balancing root
default (pools ['cephstor2']) by bytes
2018-08-20 22:33:46.156326 7f2fbc3b6700 0 mgr[balancer] Step result
score 0.001152 -> 0.001180, misplacing 0.000912
2018-08-20 22:33:46.156374 7f2fbc3b6700 0 mgr[balancer] Score got
worse, taking another step
2018-08-20 22:33:46.156581 7f2fbc3b6700 0 mgr[balancer] Balancing root
default (pools ['cephstor2']) by bytes
2018-08-20 22:33:46.233818 7f2fbc3b6700 0 mgr[balancer] Step result
score 0.001152 -> 0.001180, misplacing 0.000912
2018-08-20 22:33:46.233868 7f2fbc3b6700 0 mgr[balancer] Score got
worse, taking another step
2018-08-20 22:33:46.234043 7f2fbc3b6700 0 mgr[balancer] Balancing root
default (pools ['cephstor2']) by bytes
2018-08-20 22:33:46.313212 7f2fbc3b6700 0 mgr[balancer] Step result
score 0.001152 -> 0.001180, misplacing 0.000912
2018-08-20 22:33:46.313714 7f2fbc3b6700 0 mgr[balancer] Score got
worse, trying smaller step 0.000244
2018-08-20 22:33:46.313887 7f2fbc3b6700 0 mgr[balancer] Balancing root
default (pools ['cephstor2']) by bytes
2018-08-20 22:33:46.391586 7f2fbc3b6700 0 mgr[balancer] Step result
score 0.001152 -> 0.001152, misplacing 0.001141
2018-08-20 22:33:46.393374 7f2fbc3b6700 0 mgr[balancer] Balancing root
default (pools ['cephstor2']) by bytes
2018-08-20 22:33:46.473956 7f2fbc3b6700 0 mgr[balancer] Step result
score 0.001152 -> 0.001180, misplacing 0.000912
2018-08-20 22:33:46.474001 7f2fbc3b6700 0 mgr[balancer] Score got
worse, taking another step
2018-08-20 22:33:46.474046 7f2fbc3b6700 0 mgr[balancer] Success, score
0.001155 -> 0.001152
- ceph balancer eval myplan
plan myplan final score 0.001180 (lower is better)
So the final plan does NOT contain the expected optimization. The
deepcopy fixes it.
- ceph balancer eval myplan
plan myplan final score 0.001152 (lower is better)
Related issues
History
#1 Updated by Stefan Priebe over 5 years ago
Pull request: https://github.com/ceph/ceph/pull/23682
#2 Updated by Nathan Cutler over 5 years ago
- Status changed from New to Fix Under Review
#3 Updated by Kefu Chai over 5 years ago
- Status changed from Fix Under Review to Pending Backport
#4 Updated by Konstantin Shalygin over 5 years ago
luminous backport https://github.com/ceph/ceph/pull/23740
#5 Updated by Nathan Cutler over 5 years ago
- Copied to Backport #32080: luminous: mgr balancer does not save optimized plan but latest added
#6 Updated by Nathan Cutler over 5 years ago
- Copied to Backport #32082: mimic: mgr balancer does not save optimized plan but latest added
#7 Updated by Nathan Cutler over 5 years ago
- Status changed from Pending Backport to Resolved