]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
Revert "osd/OSDMap: allow bidirectional swap of pg-upmap-items" 17812/head
authorSage Weil <sage@redhat.com>
Fri, 15 Sep 2017 20:52:28 +0000 (16:52 -0400)
committerSage Weil <sage@redhat.com>
Tue, 19 Sep 2017 17:41:24 +0000 (12:41 -0500)
commit875f1c2519c15a94b4f4ccfa3ae0b0b191cfb1dc
treefcd1da516c91a5e40b29d7e1e7fea6baeaeeac35
parentddf84249fa8a8ec3655c39bac5331ab81c0307b1
Revert "osd/OSDMap: allow bidirectional swap of pg-upmap-items"

This reverts commit 09af9b8afb40cc8aa629501582a75e03edf0bf2e.

We need to prevent duplicates in the final result.  For example, we
can currently take
 [1,2,3] and apply [(1,2)] and get [2,2,3]
or
 [1,2,3] and apply [(3,2)] and get [1,2,2]

The rest of the system is not prepared to handle duplicates in the
result set like this.

The reverted commit was intended to allow

 [1,2,3] and [(1,2),(2,1)] to get [2,1,3]

to reorder primaries.  First, this bidirectional swap is hard to implement
in a way that also prevents dups.  For example,
 [1,2,3] and [(1,4),(2,3),(3,4)] would give [4,3,4]
but would we just drop the last step we'd have [4,3,3] which
is also invalid, etc.  Simpler to just not handle bidirectional
swaps.  In practice, they are not needed: if you just want to choose
a different primary then use primary_affinity, or pg_upmap
(not pg_upmap_items).

Fixes: http://tracker.ceph.com/issues/21410
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit 9c73305e3ad11177d58632eba6ece5d2c0e701da)
src/osd/OSDMap.cc