Skip to content

Commit

Permalink
os/bluestore: invoke _prepare_ondisk_format_super as the last op
Browse files Browse the repository at this point in the history
Fixes: https://tracker.ceph.com/issues/45133

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
  • Loading branch information
ifed01 committed Apr 22, 2020
1 parent c17f4d9 commit bb81de5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/os/bluestore/BlueStore.cc
Expand Up @@ -11084,6 +11084,9 @@ int BlueStore::_upgrade_super()
t->rmkey(PREFIX_SUPER, "min_min_alloc_size");
}
ondisk_format = 2;

// make sure upgrade is performed within a single transaction
// hence preparing new super record here other than at the end
_prepare_ondisk_format_super(t);
int r = db->submit_transaction_sync(t);
ceph_assert(r == 0);
Expand All @@ -11096,19 +11099,23 @@ int BlueStore::_upgrade_super()
// - super: added per_pool_omap key, which indicates that *all* objects
// are using the new prefix and key format
ondisk_format = 3;
KeyValueDB::Transaction t = db->get_transaction();
_prepare_ondisk_format_super(t);
int r = db->submit_transaction_sync(t);
ceph_assert(r == 0);
}
if (ondisk_format == 3) {
// changes:
// - FreelistManager keeps meta within bdev label
int r = _write_out_fm_meta(0);
ceph_assert(r == 0);

ondisk_format = 4;
}
// This to be the last operation
// Upgrade to format 2 is completed at this point,
// perform additional upgrade is needed
if (ondisk_format > 2) {
KeyValueDB::Transaction t = db->get_transaction();
_prepare_ondisk_format_super(t);
int r = db->submit_transaction_sync(t);
ceph_assert(r == 0);
}
}
// done
dout(1) << __func__ << " done" << dendl;
Expand Down

0 comments on commit bb81de5

Please sign in to comment.