mirror of
https://github.com/ceph/ceph
synced 2025-03-04 15:31:44 +00:00
osd, filestore: move automatic upgrade into mount()
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
parent
86919f5edf
commit
de52873dcf
@ -475,22 +475,6 @@ int main(int argc, const char **argv)
|
||||
global_init_daemonize(g_ceph_context, 0);
|
||||
common_init_finish(g_ceph_context);
|
||||
|
||||
if (g_conf->filestore_update_to >= (int)store->get_target_version()) {
|
||||
int err = store->mount();
|
||||
if (err < 0) {
|
||||
derr << TEXT_RED << " ** ERROR: error mounting store " << g_conf->osd_data
|
||||
<< ": " << cpp_strerror(-err) << TEXT_NORMAL << dendl;
|
||||
exit(1);
|
||||
}
|
||||
err = store->upgrade();
|
||||
store->umount();
|
||||
if (err < 0) {
|
||||
derr << TEXT_RED << " ** ERROR: error converting store " << g_conf->osd_data
|
||||
<< ": " << cpp_strerror(-err) << TEXT_NORMAL << dendl;
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
MonClient mc(g_ceph_context);
|
||||
if (mc.build_initial_monmap() < 0)
|
||||
return -1;
|
||||
|
@ -1719,6 +1719,16 @@ int FileStore::mount()
|
||||
|
||||
timer.init();
|
||||
|
||||
// upgrade?
|
||||
if (g_conf->filestore_update_to >= (int)get_target_version()) {
|
||||
int err = upgrade();
|
||||
if (err < 0) {
|
||||
derr << "error converting store" << dendl;
|
||||
umount();
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
// all okay.
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user