]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd/OSDMap: make apply_upmap handle multiple pg-upmap-items correctly
authorxie xingguo <xie.xingguo@zte.com.cn>
Sat, 24 Jun 2017 01:55:24 +0000 (09:55 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 26 Jun 2017 12:23:25 +0000 (20:23 +0800)
Was:
PG_STAT  UP      UP_PRIMARY ACTING  ACTING_PRIMARY
0.7      [1,0,4]          1 [1,0,4]              1

~#:./bin/ceph osd pg-upmap-items 0.7 0 2 1 3 4 5
set 0.7 pg_upmap_items mapping to [0,2,1,3,4,5]

PG_STAT  UP      UP_PRIMARY ACTING  ACTING_PRIMARY
0.7      [1,2,4]          1 [1,2,4]              1

Now:
PG_STAT  UP      UP_PRIMARY ACTING  ACTING_PRIMARY
0.7      [1,0,4]          1 [1,0,4]              1

~#:./bin/ceph osd pg-upmap-items 0.7 0 2 1 3 4 5
set 0.7 pg_upmap_items mapping to [0,2,1,3,4,5]

PG_STAT  UP      UP_PRIMARY ACTING  ACTING_PRIMARY
0.7      [3,2,5]          3 [3,2,5]              3

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/osd/OSDMap.cc
src/test/cli/osdmaptool/upmap.t

index 971e15d5aa0413eb08e5dbbed887173d7d9c9e78..aee8256e077ddf4427cb5ee161ac7dd7f34ca962 100644 (file)
@@ -1947,7 +1947,6 @@ void OSDMap::_apply_upmap(const pg_pool_t& pi, pg_t raw_pg, vector<int> *raw) co
       }
       if (!exists && pos >= 0) {
        (*raw)[pos] = r.second;
-       return;
       }
     }
   }
index e86a56a4f97246dd7c7d4a05ccc2a4e22183091d..1754204679417376d429f97129077a5f378e6f5e 100644 (file)
   ceph osd pg-upmap-items 0.89 8 13 54 50
   ceph osd pg-upmap-items 0.8d 219 223 210 209
   ceph osd pg-upmap-items 0.90 163 166 210 209 192 191
+  ceph osd pg-upmap-items 0.9e 210 209 27 28
   ceph osd pg-upmap-items 0.12b 54 50 227 225
   ceph osd pg-upmap-items 0.13f 54 50
   ceph osd pg-upmap-items 0.151 36 37 54 50
   ceph osd pg-upmap-items 0.1c0 78 83 43 48 54 50
   ceph osd pg-upmap-items 0.1e3 54 50 197 201
-  ceph osd pg-upmap-items 0.2c4 54 50
   $ rm -f om c