osd: osdmap write not ordered before pgs consume map
- osdmap write txn is queued
- pg consumes map, writes pg info
- pg info commits
- crash before osdmap is written
This was triggered with BlueStore. FileStore orders the transactions due to its journaling even though different sequencers are used.
osd: commit osdmaps before exposing them to PGs
handle_osd_map and the PGs use different sequencers when writing
their updates. We therefore need to make sure new osdmaps are
committed to disk before we expose them to PGs, lest they update
their info to reference a new osdmap that hasn't actually
This doesn't happen with FileStore because transactions are
ordered when they are queued, but it does affect BlueStore.
Fix by splitting handle_osd_map into two phases, one that just
persists stuff, and the second half that publishes the new maps to
the rest of the OSD.