Skip to content

Commit

Permalink
Merge pull request #10007: jewel: New pools have bogus stuck inactive…
Browse files Browse the repository at this point in the history
…/unclean HEALTH_ERR messages until they are first active and clean

Reviewed-by: Loic Dachary <ldachary@redhat.com>
  • Loading branch information
Loic Dachary committed Jul 1, 2016
2 parents 49f6c27 + 74dd035 commit a8cc366
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/osd/OSD.cc
Expand Up @@ -7521,6 +7521,7 @@ void OSD::handle_pg_create(OpRequestRef op)
history.epoch_created = created;
history.last_scrub_stamp = ci->second;
history.last_deep_scrub_stamp = ci->second;
history.last_clean_scrub_stamp = ci->second;

// project history from created epoch (handle_pg_peering_evt does
// it from msg send epoch)
Expand Down
17 changes: 16 additions & 1 deletion src/osd/PG.cc
Expand Up @@ -5892,8 +5892,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 a8cc366

Please sign in to comment.