]>
git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/OSDMap: allow bidirectional swap of pg-upmap-items
This is useful when we also want an even distribution of pg primaries across osds.
For example:
Was:
[0 1 2]
By applying bidirectional swap of pg-upmap-items mapping [[0,1],[1,0]], now:
[1 0 2]
Thus we successfully decrease the number of primaries of osd.0 by 1 without
affecting the current (even) distribution of global pgs.
Real exmaple:
./bin/ceph pg ls-by-pool rbd
PG_STAT OBJECTS MISSING_ON_PRIMARY DEGRADED MISPLACED UNFOUND BYTES LOG DISK_LOG STATE STATE_STAMP VERSION REPORTED UP UP_PRIMARY ACTING ACTING_PRIMARY LAST_SCRUB SCRUB_STAMP LAST_DEEP_SCRUB DEEP_SCRUB_STAMP
3.0 0 0 0 0 0 0 0 0 active+clean 2017-07-12 15:14:45.083441 0'0 29:13 [0,1,3] 0 [0,1,3] 0 0'0 2017-07-12 15:14:14.515989 0'0 2017-07-12 15:14:14.515989
./bin/ceph osd pg-upmap-items 3.0 0 1 1 0 3 5
set 3.0 pg_upmap_items mapping to [0->1,1->0,3->5]
./bin/ceph pg ls-by-pool rbd
PG_STAT OBJECTS MISSING_ON_PRIMARY DEGRADED MISPLACED UNFOUND BYTES LOG DISK_LOG STATE STATE_STAMP VERSION REPORTED UP UP_PRIMARY ACTING ACTING_PRIMARY LAST_SCRUB SCRUB_STAMP LAST_DEEP_SCRUB DEEP_SCRUB_STAMP
3.0 0 0 0 0 0 0 0 0 active+clean 2017-07-12 15:16:22.648424 0'0 33:13 [1,0,5] 1 [1,0,5] 1 0'0 2017-07-12 15:14:14.515989 0'0 2017-07-12 15:14:14.515989
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>