Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crush/CrushWrapper: fix potential invalid use of iterator #21325

Merged
merged 2 commits into from Apr 12, 2018

Conversation

xiexingguo
Copy link
Member

No description provided.

In choose_leaf mode we normally should have a stack of 2 and
hence below here we still need to re-check the iterator against
the stack loop.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
…ain 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>
@xiexingguo
Copy link
Member Author

@liewegas Can you look?

@xiexingguo
Copy link
Member Author

This passed two perfect (:rofl: ) rounds of rados QA run:

http://pulpito.ceph.com/xxg-2018-04-11_07:24:02-rados-wip-fix-up-seg-error-distro-basic-smithi/

http://pulpito.ceph.com/xxg-2018-04-10_09:28:18-rados-wip-fix-up-seg-error-distro-basic-smithi/

@xiexingguo xiexingguo merged commit 110015a into ceph:master Apr 12, 2018
@xiexingguo xiexingguo deleted the wip-fix-up-seg-error branch April 12, 2018 00:26
@xiexingguo
Copy link
Member Author

luminous backport: #21359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants