mirror of
https://github.com/XTXMarkets/ternfs.git
synced 2026-05-06 12:22:07 -05:00
terndbtools: retry checkpoint on all errors
Open as readonly fails with 'db corrupted' if .sst file is missing even though a reopen would succeed. It is simpler to just retry the checkpoint on all errors instead.
This commit is contained in:
@@ -76,7 +76,7 @@ static void createCheckpoint(const std::string& dbPath, const std::string& check
|
||||
std::vector<rocksdb::ColumnFamilyHandle*> handles;
|
||||
s = rocksdb::DB::OpenForReadOnly(dbOptions, dbPath, cfDescriptors, &handles, &db);
|
||||
if (!s.ok()) {
|
||||
if (s.IsPathNotFound() && attempt + 1 < maxRetries) {
|
||||
if (attempt + 1 < maxRetries) {
|
||||
LOG_INFO(env, "Open failed (compaction race), retrying (%s/%s): %s",
|
||||
attempt + 1, maxRetries, s.ToString());
|
||||
sleep(1);
|
||||
@@ -104,7 +104,7 @@ static void createCheckpoint(const std::string& dbPath, const std::string& check
|
||||
return;
|
||||
}
|
||||
|
||||
if (s.IsPathNotFound() && attempt + 1 < maxRetries) {
|
||||
if (attempt + 1 < maxRetries) {
|
||||
LOG_INFO(env, "Checkpoint failed (compaction race), retrying (%s/%s): %s",
|
||||
attempt + 1, maxRetries, s.ToString());
|
||||
std::error_code ec;
|
||||
|
||||
Reference in New Issue
Block a user