]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crush/CrushWrapper: don't bump up leaf stack if we are already of domain OSD 21359/head
authorxie xingguo <xie.xingguo@zte.com.cn>
Tue, 10 Apr 2018 07:43:05 +0000 (15:43 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Thu, 12 Apr 2018 00:39:58 +0000 (08:39 +0800)
commit939bcbccb979a8a45a09ba4fa1d8d6659a54f6bd
treea881f4e88a119cb849b0a99b10b97f9f95b922b5
parentc89db880db86540bc97f7e56a2d84aca29b33596
crush/CrushWrapper: don't bump up leaf stack if we are already of domain OSD

Assume we have a pool of crush-failure-domain OSD, then the stack will look like:
[
  "0":"8"                  // stack[0]
  "0":"1"                  // stack[1]
]

The above stack is error-prone because when passed to _choose_type_stack(),
iterator **i** shall already point to orig.end() when stack[0] is done
and might still get incremented while we continues to handle stack[1], and
hence produce the following abnormal (**overflowed**) mapping results:

```
   -36> 2018-04-06 23:06:35.041274 7f84692bd700 10  total_deviation 24.6667 overfull 4,5,6,7,8 underfull [2,0,3,9]
   -35> 2018-04-06 23:06:35.041278 7f84692bd700 10  osd.7 move 3
   -34> 2018-04-06 23:06:35.041280 7f84692bd700 10   trying 2.0
   -33> 2018-04-06 23:06:35.041310 7f84692bd700 10   2.0 [3,5,6,4,9,0,7,10] -> [1953720676,1683976050,1919120229,1769238633,838889071,3224629,101,2]
   -32> 2018-04-06 23:06:35.041317 7f84692bd700 10   2.0 pg_upmap_items [3,1953720676,5,1683976050,6,1919120229,4,1769238633,9,838889071,0,3224629,7,101,10,2]
```

See also:
http://pulpito.ceph.com/yuriw-2018-04-06_21:35:03-rados-wip-yuri2-testing-2018-04-06-1946-luminous-distro-basic-smithi/2365151/

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
(cherry picked from commit 47155949856e50d03b50993423acedddd14546e2)
src/crush/CrushWrapper.cc