Skip to content

Commit

Permalink
osd/PG: set last_* PG fields on a creating PG
Browse files Browse the repository at this point in the history
Use the value from pg_history_t that ultimately came from the
mon if last_epoch_started == 0.  This establishes a sane lower
bound on these timestamps, and prevents a mon health error from
coming up about how a PG is stuck in whatever state while it is
being created.

(We addressed half of this problem in commit 6ca6aea, but the
warning comes back as soon as the OSD reports with a creating
state.)

Fixes: http://tracker.ceph.com/issues/14952
Signed-off-by: Sage Weil <sage@redhat.com>
  • Loading branch information
liewegas committed May 2, 2016
1 parent 47f540d commit 3be3bc6
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/osd/PG.cc
Expand Up @@ -5865,8 +5865,23 @@ PG::RecoveryState::Primary::Primary(my_context ctx)
assert(pg->want_acting.empty());

// set CREATING bit until we have peered for the first time.
if (pg->info.history.last_epoch_started == 0)
if (pg->info.history.last_epoch_started == 0) {
pg->state_set(PG_STATE_CREATING);
// use the history timestamp, which ultimately comes from the
// monitor in the create case.
utime_t t = pg->info.history.last_scrub_stamp;
pg->info.stats.last_fresh = t;
pg->info.stats.last_active = t;
pg->info.stats.last_change = t;
pg->info.stats.last_peered = t;
pg->info.stats.last_clean = t;
pg->info.stats.last_unstale = t;
pg->info.stats.last_undegraded = t;
pg->info.stats.last_fullsized = t;
pg->info.stats.last_scrub_stamp = t;
pg->info.stats.last_deep_scrub_stamp = t;
pg->info.stats.last_clean_scrub_stamp = t;
}
}

boost::statechart::result PG::RecoveryState::Primary::react(const MNotifyRec& notevt)
Expand Down

0 comments on commit 3be3bc6

Please sign in to comment.