pg_pool_t const *metadata_pool = mon->osdmon()->osdmap.get_pg_pool(metadata);
assert(metadata_pool != NULL); // Checked it existed above
- // Automatically set crash_replay_interval on data pool if it
- // isn't already set.
- if (data_pool->get_crash_replay_interval() == 0) {
- r = mon->osdmon()->set_crash_replay_interval(data, g_conf->osd_default_data_pool_replay_window);
- assert(r == 0); // We just did get_pg_pool so it must exist and be settable
- request_proposal(mon->osdmon());
- }
-
+ // we must make these checks before we even allow ourselves to *think*
+ // about requesting a proposal to the osdmonitor and bail out now if
+ // we believe we must. bailing out *after* we request the proposal is
+ // bad business as we could have changed the osdmon's state and ending up
+ // returning an error to the user.
r = _check_pool(data, &ss);
if (r) {
return true;
return true;
}
+ // Automatically set crash_replay_interval on data pool if it
+ // isn't already set.
+ if (data_pool->get_crash_replay_interval() == 0) {
+ r = mon->osdmon()->set_crash_replay_interval(data, g_conf->osd_default_data_pool_replay_window);
+ assert(r == 0); // We just did get_pg_pool so it must exist and be settable
+ request_proposal(mon->osdmon());
+ }
+
// All checks passed, go ahead and create.
MDSMap newmap;
newmap.inc = pending_mdsmap.inc;