]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd: OSDMonitor: ignore pgtemps from removed pool
authorJoao Eduardo Luis <joao.luis@inktank.com>
Tue, 28 Jan 2014 15:54:33 +0000 (15:54 +0000)
committerSage Weil <sage@inktank.com>
Tue, 28 Jan 2014 19:19:58 +0000 (11:19 -0800)
commitf1b5309356da26803238610a6ca14265e0176730
tree4c02de8094468c477bd0569df2e31312125861dc
parentff5abfbdae07ae8a56fa83ebaa92000896f793c2
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>
(cherry picked from commit f513f66f48383a07c70ca18a4dba6c2449ea9860)
src/mon/OSDMonitor.cc