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:
CJ Cobb
2022-01-07 14:48:48 -05:00
committed by GitHub
parent 628ede5bdb
commit 6e6f47421d
10 changed files with 84 additions and 65 deletions

View File

@@ -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;