:command:`compact-range <prefix> <start> <end>`
Compact some entries specified by the URL encoded prefix and range.
-:command:`repair`
- Try to repair the kvstore.
+:command:`destructive-repair`
+ Make a (potentially destructive) effort to recover a corrupted database.
+ Note that in the case of rocksdb this may corrupt an otherwise uncorrupted
+ database--use this only as a last resort!
Availability
============
db->compact_range(prefix, start, end);
}
- int repair() {
+ int destructive_repair() {
return db->repair(std::cout);
}
};
<< " compact\n"
<< " compact-prefix <prefix>\n"
<< " compact-range <prefix> <start> <end>\n"
- << " repair\n"
+ << " destructive-repair (use only as last resort! may corrupt healthy data)\n"
<< std::endl;
}
string path(args[1]);
string cmd(args[2]);
- bool need_open_db = (cmd != "repair");
+ bool need_open_db = (cmd != "destructive-repair");
StoreTool st(type, path, need_open_db);
- if (cmd == "repair") {
- int ret = st.repair();
+ if (cmd == "destructive-repair") {
+ int ret = st.destructive_repair();
if (!ret) {
- std::cout << "repair kvstore successfully" << std::endl;
+ std::cout << "destructive-repair completed without reporting an error"
+ << std::endl;
} else {
- std::cout << "repair kvstore failed" << std::endl;
+ std::cout << "destructive-repair failed with " << cpp_strerror(ret)
+ << std::endl;
}
return ret;
} else if (cmd == "list" || cmd == "list-crc") {