Previously it was possible to lose PG creations if a monitor election
happened at the right time. The issue would get rectified on the
next OSDMap update, but that could take...a while. (My observed time
when I discovered the bug had it go without creation for 43 minutes,
at which point I killed it.)
Signed-off-by: Greg Farnum <gregory.farnum@dreamhost.com>
last_osd_report.clear();
}
+void PGMonitor::on_active()
+{
+ if (mon->is_leader()) {
+ check_osd_map(mon->osdmon()->osdmap.epoch);
+ }
+}
+
void PGMonitor::tick()
{
if (!paxos->is_active()) return;
new_pool);
}
}
- }
+ }
int max = MIN(osdmap->get_max_osd(), osdmap->crush.get_max_devices());
int removed = 0;
virtual void on_election_start();
+ /* Courtesy function provided by PaxosService, called when an election
+ * finishes and the cluster goes active. We use it here to make sure we
+ * haven't lost any PGs from new pools. */
+ virtual void on_active();
+
void tick(); // check state, take actions
void check_osd_map(epoch_t epoch);