pgmon: PGMap::creating_pgs is not checked on leader election
So, state is lost when the leader changes. This needs a little bit of thought to handle leaders updating their maps properly.
#4 Updated by Greg Farnum about 9 years ago
Ah, not quite what I thought it was. creating_pgs is actually maintained via stat_pg_[add|sub], and it's done correctly. The problem is that creating_pgs is only dealt with in register_new_pgs, which is only called via check_osd_map, which is only called by OSDMonitor::update_from_paxos. Which is called frequently, but backs out unless there's a new map it didn't have before.
And if your cluster is stable, you can keep the same OSD map for a looooooong time.
Which meant that if you got a new leader election at the wrong time, you could have PG creations that are indefinitely delayed. To handle this, use the virtual on_active() method and call check_osd_map (if you're the leader.