Skip to content

Commit

Permalink
osd: only set CLEAN when we are not remapped (up == acting)
Browse files Browse the repository at this point in the history
If we have a temporary mapping for this PG, consider that unclean.  This
makes CLEAN and REMAPPED mutually exclusive.  For example, a 2 node cluster
with 2x replication and one osd marked out will make the pgs all
active+remapped, not active+clean+remapped.

Fixes: ceph#2094
Signed-off-by: Sage Weil <[email protected]>
  • Loading branch information
liewegas committed Feb 23, 2012
1 parent d8df565 commit e8bc42f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/osd/PG.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1538,8 +1538,10 @@ void PG::finish_recovery(ObjectStore::Transaction& t, list<Context*>& tfin)
state_clear(PG_STATE_BACKFILL);
state_clear(PG_STATE_RECOVERING);

// only mark CLEAN if we have the desired number of replicas.
if (acting.size() == get_osdmap()->get_pg_size(info.pgid))
// only mark CLEAN if we have the desired number of replicas AND we
// are not remapped.
if (acting.size() == get_osdmap()->get_pg_size(info.pgid) &&
up == acting)
state_set(PG_STATE_CLEAN);

assert(info.last_complete == info.last_update);
Expand Down

0 comments on commit e8bc42f

Please sign in to comment.