Improve LedgerMaster shard acquisition

This commit is contained in:
Miguel Portilla
2020-05-21 18:19:21 -04:00
committed by manojsdoshi
parent 8f50fd051e
commit 91e857874f
8 changed files with 77 additions and 40 deletions

View File

@@ -184,11 +184,8 @@ Shard::open(Scheduler& scheduler, nudb::context& ctx)
}
if (boost::icl::length(storedSeqs) == maxLedgers_)
{
// All ledgers have been acquired, shard is complete
acquireInfo_.reset();
backendComplete_ = true;
}
}
}
else
@@ -292,7 +289,6 @@ Shard::store(std::shared_ptr<Ledger const> const& ledger)
if (!initSQLite(lock))
return false;
acquireInfo_.reset();
backendComplete_ = true;
setBackendCache(lock);
}
@@ -574,8 +570,8 @@ Shard::finalize(
}
hash = ledger->info().parentHash;
next = std::move(ledger);
--seq;
next = ledger;
}
JLOG(j_.debug()) << "shard " << index_ << " is valid";