When ceph-objecstore-tool starts, if the user has specified a pgid that
does not exist, the command should exit with a helpful error message.
This fixes tracker https://tracker.ceph.com/issues/72536
Signed-off-by: Alex Ainscow <aainscow@uk.ibm.com>
}
if (pgidstr != "meta") {
auto ch = fs->open_collection(coll_t(pgid));
+ if (!ch) {
+ stringstream ss;
+ cerr << "PG '" << pgid << "' not found" << std::endl;
+ throw std::runtime_error(ss.str());
+ }
if (!ghobj.match(fs->collection_bits(ch), pgid.ps())) {
stringstream ss;
ss << "object " << ghobj << " not contained by pg " << pgid;