PriorSet &prior(*prior_set.get());
if (prior.crashed) {
- state_set(PG_STATE_CRASHED);
+ state_set(PG_STATE_REPLAY);
}
if (prior.pg_down) {
state_set(PG_STATE_DOWN);
map<int, MOSDPGInfo*> *activator_map)
{
assert(!is_active());
+
// -- crash recovery?
- if (is_crashed()) {
+ if (is_replay()) {
if (g_conf->osd_replay_window > 0) {
replay_until = ceph_clock_now(g_ceph_context);
replay_until += g_conf->osd_replay_window;
dout(10) << "crashed, allowing op replay for " << g_conf->osd_replay_window
<< " until " << replay_until << dendl;
- state_set(PG_STATE_REPLAY);
osd->replay_queue_lock.Lock();
osd->replay_queue.push_back(pair<pg_t,utime_t>(info.pgid, replay_until));
osd->replay_queue_lock.Unlock();
} else {
dout(10) << "crashed, but osd_replay_window=0. skipping replay." << dendl;
+ state_clear(PG_STATE_REPLAY);
}
}
state_clear(PG_STATE_STRAY);
state_clear(PG_STATE_DOWN);
state_clear(PG_STATE_PEERING);
- state_clear(PG_STATE_CRASHED);
if (is_primary() &&
osd->osdmap->get_pg_size(info.pgid) != acting.size())
state_set(PG_STATE_DEGRADED);
void PG::replay_queued_ops()
{
- assert(is_replay() && is_active() && !is_crashed());
+ assert(is_replay() && is_active());
eversion_t c = info.last_update;
list<Message*> replay;
dout(10) << "replay_queued_ops" << dendl;
replay_queue.clear();
osd->requeue_ops(this, replay);
osd->requeue_ops(this, waiting_for_active);
- state_clear(PG_STATE_REPLAY);
+
update_stats();
}
state_clear(PG_STATE_PEERING); // we'll need to restart peering
state_clear(PG_STATE_DEGRADED);
state_clear(PG_STATE_REPLAY);
- state_clear(PG_STATE_CRASHED);
osd->cancel_generate_backlog(this);
int get_state() const { return state; }
bool is_active() const { return state_test(PG_STATE_ACTIVE); }
bool is_peering() const { return state_test(PG_STATE_PEERING); }
- bool is_crashed() const { return state_test(PG_STATE_CRASHED); }
bool is_down() const { return state_test(PG_STATE_DOWN); }
bool is_replay() const { return state_test(PG_STATE_REPLAY); }
bool is_clean() const { return state_test(PG_STATE_CLEAN); }
#define PG_STATE_CREATING (1<<0) // creating
#define PG_STATE_ACTIVE (1<<1) // i am active. (primary: replicas too)
#define PG_STATE_CLEAN (1<<2) // peers are complete, clean of stray replicas.
-#define PG_STATE_CRASHED (1<<3) // all replicas went down, clients needs to replay
#define PG_STATE_DOWN (1<<4) // a needed replica is down, PG offline
#define PG_STATE_REPLAY (1<<5) // crashed, waiting for replay
#define PG_STATE_STRAY (1<<6) // i must notify the primary i exist.