mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-19 11:15:50 +00:00
base case for fetch ledger page
This commit is contained in:
@@ -247,9 +247,23 @@ public:
|
||||
} while (page.objects.size() < limit && page.cursor);
|
||||
if (incomplete)
|
||||
{
|
||||
std::cout << "checking lower" << std::endl;
|
||||
auto rng = fetchLedgerRange();
|
||||
if (!rng)
|
||||
return page;
|
||||
if (rng->minSequence == ledgerSequence)
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(fatal)
|
||||
<< __func__
|
||||
<< " Database is populated but first flag ledger is "
|
||||
"incomplete. This should never happen";
|
||||
assert(false);
|
||||
throw std::runtime_error("Missing base flag ledger");
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(debug) << __func__ << " recursing";
|
||||
uint32_t lowerSequence = ledgerSequence >> indexer_.getKeyShift()
|
||||
<< indexer_.getKeyShift();
|
||||
if (lowerSequence < rng->minSequence)
|
||||
lowerSequence = rng->minSequence;
|
||||
auto lowerPage = fetchLedgerPage(cursor, lowerSequence, limit);
|
||||
std::vector<ripple::uint256> keys;
|
||||
std::transform(
|
||||
|
||||
@@ -790,7 +790,7 @@ CREATE TABLE IF NOT EXISTS objects (
|
||||
object bytea
|
||||
) PARTITION BY RANGE (ledger_seq);
|
||||
|
||||
CREATE INDEX objects_idx ON objects USING btree(ledger_seq,key);
|
||||
CREATE INDEX objects_idx ON objects USING btree(key,ledger_seq);
|
||||
|
||||
create table if not exists objects1 partition of objects for values from (0) to (10000000);
|
||||
create table if not exists objects2 partition of objects for values from (10000000) to (20000000);
|
||||
|
||||
Reference in New Issue
Block a user