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

mon,osd: add crush_version to OSDMap, and allow crush map updates to gate on crush_version #15533

Merged
merged 5 commits into from Jun 19, 2017

Conversation

Projects
None yet
2 participants
@liewegas
Member

liewegas commented Jun 7, 2017

This allows safe offline updates to the crush map. The caller can fetch the map,
note the version, go make some changes, and when reinjecting the map, specify the
same version to ensure there weren't intervening updates.

@liewegas liewegas requested a review from Jun 7, 2017

@ghost

We need to increase the version whenever the crushmap is modified via ceph osd new etc. This probably is the most likely source of race. Uploading a crushmap on a regular basis is going to be done by the mgr and no other. Adding / removing OSDs / buckets is going to be done by the sysadmin and will race against optimization.

@liewegas

This comment has been minimized.

Member

liewegas commented Jun 7, 2017

Since crush_version is an OSDMap field and it's updated in OSDMap::apply_incremental(), it should capture any change to the crush map, since that's the only path for it to update in OSDMap.

@ghost

This comment has been minimized.

ghost commented Jun 7, 2017

nice !

@ghost

ghost approved these changes Jun 7, 2017

@yuriw

This comment has been minimized.

Contributor

yuriw commented Jun 8, 2017

test this please

@liewegas

This comment has been minimized.

Member

liewegas commented Jun 12, 2017

retest this please

liewegas added some commits Jun 7, 2017

osd/OSDMap: add crush_version
Increment it every time our embedded crush map updates.

Signed-off-by: Sage Weil <sage@redhat.com>
mon/OSDMonitor: report crush_version for get and set crush map
Signed-off-by: Sage Weil <sage@redhat.com>
mon/OSDMonitor: add prior_version arg to 'osd crush set', 'osd setcru…
…shmap'

If the prior_version doesn't match, reject the update.

Note that we also allow the crush_version-1 iff the proposed map is
identical to the current map in order to make the command idempotent.

Signed-off-by: Sage Weil <sage@redhat.com>
mgr/MgrClient: skip sending stats if no session
Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas

This comment has been minimized.

Member

liewegas commented Jun 17, 2017

retest this please

qa/workunits/cephtool/test.sh: silence dev warnings
Signed-off-by: Sage Weil <sage@redhat.com>

@liewegas liewegas merged commit 36cb462 into ceph:master Jun 19, 2017

3 of 4 checks passed

arm64 make check arm64 make check failed
Details
Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details

@liewegas liewegas deleted the liewegas:wip-crush-version branch Jun 19, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment