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: reset bucket->h.items[i] when removing tree item #10093

Merged
merged 1 commit into from Jul 4, 2016

Conversation

tchaikov
Copy link
Contributor

@tchaikov tchaikov commented Jul 1, 2016

  • crush so we don't see the reference after the removing, this keeps
    check_item_loc() happy, and move_bucket() use check_item_loc() to see if
    the removed bucket disappears after the removal.
  • test: also add unittest_crush_wrapper::CrushWrapper.insert_item

Fixes: http://tracker.ceph.com/issues/16525
Signed-off-by: Kefu Chai kchai@redhat.com

* crush: so we don't see the reference after the removing, this keeps
  check_item_loc() happy, and move_bucket() use check_item_loc() to see if
  the removed bucket disappears after the removal.
* test: also add unittest_crush_wrapper::CrushWrapper.insert_item

Fixes: http://tracker.ceph.com/issues/16525
Signed-off-by: Kefu Chai <kchai@redhat.com>
@tchaikov
Copy link
Contributor Author

tchaikov commented Jul 1, 2016

@liewegas mind taking a look?

@liewegas
Copy link
Member

liewegas commented Jul 1, 2016

looks good to me!

@tchaikov tchaikov merged commit e0f15d9 into ceph:master Jul 4, 2016
@tchaikov tchaikov deleted the wip-16525 branch July 4, 2016 13:42
@xiaoxichen
Copy link
Contributor

@tchaikov , sorry, I tried to reproduce in my env with hammer and jewel but didn't see this bug...but it's really a bug from code...would you mind sharing how this can be trigger?

I did
ceph osd crush add-bucket test root
ceph osd crush add-bucket test1 root
ceph osd crush add-bucket myhost host
ceph osd crush move myhost root=test
ceph osd crush move myhost root=test1

everything looks fine

@tchaikov
Copy link
Contributor Author

tchaikov commented Jul 5, 2016

@xiaoxichen you could try to reproduce it using the crush map offered by http://tracker.ceph.com/issues/16525.

to trigger this issue, in short

  • bucket type should be tree (it's straw2 by default nowadays)
  • should be removing a bucket from its parent
  • the removed bucket is not the last one

@xiaoxichen
Copy link
Contributor

@tchaikov , thanks ,good to know, we are safe as we are in straw:)

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