1
0
mirror of https://github.com/ceph/ceph synced 2025-02-18 16:37:41 +00:00

Merge pull request from ifed01/wip-ifed-remove-assert-bs-tool

os/bluestore/bluestore-tool: minor fixes around migrate

Reviewed-by: Adam Kupczyk <akupczyk@redhat.com>
This commit is contained in:
Kefu Chai 2019-07-05 11:12:53 +08:00 committed by GitHub
commit 9e435474ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -691,8 +691,14 @@ int main(int argc, char **argv)
for (auto& s : devs_source) {
auto i = cur_devs_map.find(s);
if (i != cur_devs_map.end()) {
src_devs.emplace(*i);
src_dev_ids.emplace(i->second);
if (s == dev_target) {
cerr << "Device " << dev_target
<< " is present in both source and target lists, omitted."
<< std::endl;
} else {
src_devs.emplace(*i);
src_dev_ids.emplace(i->second);
}
} else {
cerr << "can't migrate " << s << ", not a valid bluefs volume "
<< std::endl;
@ -713,8 +719,6 @@ int main(int argc, char **argv)
exit(EXIT_FAILURE);
}
bool need_db = dev_target_id == BlueFS::BDEV_NEWDB;
BlueStore bluestore(cct.get(), path);
int r = bluestore.migrate_to_existing_bluefs_device(
src_dev_ids,
@ -727,13 +731,14 @@ int main(int argc, char **argv)
}
}
} else {
bool need_db = dev_target_id == BlueFS::BDEV_DB;
cerr << "failed to migrate to existing BlueFS device: "
<< (need_db ? BlueFS::BDEV_DB : BlueFS::BDEV_DB)
<< (need_db ? BlueFS::BDEV_DB : BlueFS::BDEV_WAL)
<< " " << dev_target
<< cpp_strerror(r)
<< std::endl;
}
ceph_assert(r == 0);
return r;
} else {
// Migrate to a new BlueFS volume
// via creating either DB or WAL volume