cout << " lc list list all bucket lifecycle progress\n";
cout << " lc get get a lifecycle bucket configuration\n";
cout << " lc process manually process lifecycle\n";
- cout << " lc fix fix LC for a resharded bucket\n";
+ cout << " lc reshard fix fix LC for a resharded bucket\n";
cout << " metadata get get metadata info\n";
cout << " metadata put put metadata info\n";
cout << " metadata rm remove metadata info\n";
OPT_LC_LIST,
OPT_LC_GET,
OPT_LC_PROCESS,
- OPT_LC_FIX,
+ OPT_LC_RESHARD_FIX,
OPT_ORPHANS_FIND,
OPT_ORPHANS_FINISH,
OPT_ORPHANS_LIST_JOBS,
return OPT_LC_GET;
if (strcmp(cmd, "process") == 0)
return OPT_LC_PROCESS;
+ } else if ((prev_prev_cmd && strcmp(prev_prev_cmd, "lc") == 0) &&
+ strcmp(prev_cmd, "reshard") == 0) {
if (strcmp(cmd, "fix") == 0)
- return OPT_LC_FIX;
+ return OPT_LC_RESHARD_FIX;
} else if (strcmp(prev_cmd, "orphans") == 0) {
if (strcmp(cmd, "find") == 0)
return OPT_ORPHANS_FIND;
}
- if (opt_cmd == OPT_LC_FIX) {
- rgw_bucket bucket;
- RGWBucketInfo bucket_info;
- map<string, bufferlist> attrs;
- ret = init_bucket(tenant, bucket_name, bucket_id, bucket_info, bucket, &attrs);
+ if (opt_cmd == OPT_LC_RESHARD_FIX) {
+ ret = RGWBucketAdminOp::fix_lc_shards(store, bucket_op,f);
if (ret < 0) {
- cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
- return -ret;
+ cerr << "ERROR: listing stale instances" << cpp_strerror(-ret) << std::endl;
}
- ret = rgw::lc::fix_lc_shard_entry(store, bucket_info, attrs);
- if (ret < 0) {
- cerr << "ERROR: fixing lc shard entry failed with" << cpp_strerror(-ret) << std::endl;
- }
}
if (opt_cmd == OPT_ORPHANS_FIND) {
lc list list all bucket lifecycle progress
lc get get a lifecycle bucket configuration
lc process manually process lifecycle
- lc fix fix LC for a resharded bucket
+ lc reshard fix fix LC for a resharded bucket
metadata get get metadata info
metadata put put metadata info
metadata rm remove metadata info