mirror of
https://github.com/XRPLF/clio.git
synced 2025-11-20 19:56:00 +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);
|
} while (page.objects.size() < limit && page.cursor);
|
||||||
if (incomplete)
|
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()
|
uint32_t lowerSequence = ledgerSequence >> indexer_.getKeyShift()
|
||||||
<< indexer_.getKeyShift();
|
<< indexer_.getKeyShift();
|
||||||
|
if (lowerSequence < rng->minSequence)
|
||||||
|
lowerSequence = rng->minSequence;
|
||||||
auto lowerPage = fetchLedgerPage(cursor, lowerSequence, limit);
|
auto lowerPage = fetchLedgerPage(cursor, lowerSequence, limit);
|
||||||
std::vector<ripple::uint256> keys;
|
std::vector<ripple::uint256> keys;
|
||||||
std::transform(
|
std::transform(
|
||||||
|
|||||||
@@ -790,7 +790,7 @@ CREATE TABLE IF NOT EXISTS objects (
|
|||||||
object bytea
|
object bytea
|
||||||
) PARTITION BY RANGE (ledger_seq);
|
) 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 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);
|
create table if not exists objects2 partition of objects for values from (10000000) to (20000000);
|
||||||
|
|||||||
Reference in New Issue
Block a user