mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-22 04:35:50 +00:00
Postgres fixes (#84)
* Postgres fixes * Create partial index for ledger_diffs, to avoid indexing the first ledger's objects * Don't write duplicate keys to successor table * default to 4 markers when syncing cache * remove isFirst from writeLedger interface
This commit is contained in:
@@ -8,16 +8,8 @@ BackendInterface::finishWrites(uint32_t ledgerSequence)
|
||||
auto commitRes = doFinishWrites();
|
||||
if (commitRes)
|
||||
{
|
||||
isFirst_ = false;
|
||||
updateRange(ledgerSequence);
|
||||
}
|
||||
else
|
||||
{
|
||||
// if commitRes is false, we are relinquishing control of ETL. We
|
||||
// reset isFirst_ to true so that way if we later regain control of
|
||||
// ETL, we trigger the index repair
|
||||
isFirst_ = true;
|
||||
}
|
||||
return commitRes;
|
||||
}
|
||||
void
|
||||
@@ -242,8 +234,9 @@ BackendInterface::fetchLedgerPage(
|
||||
std::vector<ripple::uint256> keys;
|
||||
while (keys.size() < limit)
|
||||
{
|
||||
ripple::uint256 const& curCursor =
|
||||
keys.size() ? keys.back() : cursor ? *cursor : firstKey;
|
||||
ripple::uint256 const& curCursor = keys.size() ? keys.back()
|
||||
: cursor ? *cursor
|
||||
: firstKey;
|
||||
auto succ = fetchSuccessorKey(curCursor, ledgerSequence);
|
||||
if (!succ)
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user