Skip to content

osd: OSDMonitor: ignore pgtemps from removed pool#1153

Merged
liewegas merged 1 commit intomasterfrom
wip-7116-joao
Jan 28, 2014
Merged

osd: OSDMonitor: ignore pgtemps from removed pool#1153
liewegas merged 1 commit intomasterfrom
wip-7116-joao

Conversation

@jecluis
Copy link
Copy Markdown
Member

@jecluis jecluis commented Jan 28, 2014

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

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 liewegas merged commit da2da48 into master Jan 28, 2014
@liewegas liewegas deleted the wip-7116-joao branch January 28, 2014 19:20
liewegas pushed a commit that referenced this pull request Dec 14, 2016
tasks/ceph: construct CephManager earlier
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants