mirror of
https://github.com/ceph/ceph
synced 2025-01-17 08:21:47 +00:00
ceph_objectstore_tool: Add operation "rm-past-intervals" for testing purposes
Signed-off-by: David Zafman <david.zafman@inktank.com>
This commit is contained in:
parent
9325ec15d4
commit
3694068b67
@ -1520,7 +1520,7 @@ int main(int argc, char **argv)
|
||||
("pgid", po::value<string>(&pgidstr),
|
||||
"PG id, mandatory except for import, list-lost, fix-lost")
|
||||
("op", po::value<string>(&op),
|
||||
"Arg is one of [info, log, remove, export, import, list, list-lost, fix-lost, list-pgs]")
|
||||
"Arg is one of [info, log, remove, export, import, list, list-lost, fix-lost, list-pgs, rm-past-intervals]")
|
||||
("file", po::value<string>(&file),
|
||||
"path of file to export or import")
|
||||
("debug", "Enable diagnostic output to stderr")
|
||||
@ -2186,8 +2186,21 @@ int main(int argc, char **argv)
|
||||
formatter->close_section();
|
||||
formatter->flush(cout);
|
||||
cout << std::endl;
|
||||
} else if (op == "rm-past-intervals") {
|
||||
ObjectStore::Transaction tran;
|
||||
ObjectStore::Transaction *t = &tran;
|
||||
|
||||
cout << "Remove past-intervals " << past_intervals << std::endl;
|
||||
|
||||
past_intervals.clear();
|
||||
ret = write_info(*t, map_epoch, info, struct_ver, past_intervals);
|
||||
|
||||
if (ret == 0) {
|
||||
fs->apply_transaction(*t);
|
||||
cout << "Removal succeeded" << std::endl;
|
||||
}
|
||||
} else {
|
||||
cerr << "Must provide --op (info, log, remove, export, import, list, list-lost, fix-lost, list-pgs)"
|
||||
cerr << "Must provide --op (info, log, remove, export, import, list, list-lost, fix-lost, list-pgs, rm-past-intervals)"
|
||||
<< std::endl;
|
||||
usage(desc);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user