osd: OSDMonitor: ignore pgtemps from removed pool#1153
Merged
Conversation
There's a window in-between receiving an MOSDPGTemp message from an OSD and actually handling it that may lead to the pool the pg temps refer to no longer existing. This may happen if the MOSDPGTemp message is queued pending dispatching due to an on-going proposal (maybe even the pool removal). This patch fixes such behavior in two steps: 1. Check if the pool exists in the osdmap upon preprocessing - if pool does not exist in the osdmap, then the pool must have been removed prior to handling the message, but after the osd sent it. - safe to ignore the pg update 2. If all pg updates in the message have been ignored, ignore the whole message. Otherwise, let prepare handle the rest. 3. Recheck if pool exists in the osdmap upon prepare - We may have ignored this pg back in preprocess, but other pgs in the message may have led the message to be passed on to prepare; ignore pg update once more. 4. Check if pool is pending removal and ignore pg update if so. We delegate checking the pending value to prepare_pgtemp() because in this case we should only ignore the update IFF the pending value is in fact committed. Otherwise we should retry the message. prepare_pgtemp() is the appropriate place to do so. Fixes: 7116 Signed-off-by: Joao Eduardo Luis <joao.luis@inktank.com>
liewegas
pushed a commit
that referenced
this pull request
Jan 28, 2014
osd: OSDMonitor: ignore pgtemps from removed pool Reviewed-by: Sage Weil <sage@inktank.com>
liewegas
pushed a commit
that referenced
this pull request
Dec 14, 2016
tasks/ceph: construct CephManager earlier
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There's a window in-between receiving an MOSDPGTemp message from an OSD
and actually handling it that may lead to the pool the pg temps refer to
no longer existing. This may happen if the MOSDPGTemp message is queued
pending dispatching due to an on-going proposal (maybe even the pool
removal).
This patch fixes such behavior in two steps:
removed prior to handling the message, but after the osd sent it.
message. Otherwise, let prepare handle the rest.
message may have led the message to be passed on to prepare; ignore
pg update once more.
We delegate checking the pending value to prepare_pgtemp() because in this
case we should only ignore the update IFF the pending value is in fact
committed. Otherwise we should retry the message. prepare_pgtemp() is
the appropriate place to do so.
Fixes: 7116
Signed-off-by: Joao Eduardo Luis joao.luis@inktank.com