]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
osd: OSDMonitor: ignore pgtemps from removed pool 1153/head
authorJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 28 Jan 2014 15:54:33 +0000 (15:54 +0000)
committerJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 28 Jan 2014 17:22:28 +0000 (17:22 +0000)
commitf513f66f48383a07c70ca18a4dba6c2449ea9860
tree4561c27a4ac8f98b598ce77bf596d8fa42517db1
parent102c83a338d8262511b73a2f6e72042ff0062a80
osd: OSDMonitor: ignore pgtemps from removed pool

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>
src/mon/OSDMonitor.cc