@@ -1120,9 +1120,8 @@ BucketManager::startBackgroundEvictionScan(uint32_t ledgerSeq,
1120
1120
[bl = std::move (searchableBL), iter = cfg.evictionIterator (), ledgerSeq,
1121
1121
ledgerVers, sas, &counters = mBucketListEvictionCounters ,
1122
1122
stats = mEvictionStatistics ] {
1123
- return std::make_unique<EvictionResultCandidates>(
1124
- bl->scanForEviction (ledgerSeq, counters, iter, stats, sas,
1125
- ledgerVers));
1123
+ return bl->scanForEviction (ledgerSeq, counters, iter, stats, sas,
1124
+ ledgerVers);
1126
1125
});
1127
1126
1128
1127
mEvictionFuture = task->get_future ();
@@ -1270,8 +1269,6 @@ BucketManager::assumeState(HistoryArchiveState const& has,
1270
1269
releaseAssert (threadIsMain ());
1271
1270
releaseAssertOrThrow (mConfig .MODE_ENABLES_BUCKETLIST );
1272
1271
1273
- // Dependency: HAS supports Hot Archive BucketList
1274
-
1275
1272
auto processBucketList = [&](auto & bl, auto const & hasBuckets) {
1276
1273
auto kNumLevels = std::remove_reference<decltype (bl)>::type::kNumLevels ;
1277
1274
using BucketT =
@@ -1652,46 +1649,36 @@ BucketManager::scheduleVerifyReferencedBucketsWork(
1652
1649
continue ;
1653
1650
}
1654
1651
1655
- // Returns filename, hash, and whether it's a hot archive bucket
1656
- auto loadFilenameAndHash =
1657
- [&]() -> std::tuple<std::string, Hash, bool > {
1658
- auto live = getBucketByHashInternal (h, mSharedLiveBuckets );
1659
- if (!live)
1660
- {
1661
- auto hot = getBucketByHashInternal (h, mSharedHotArchiveBuckets );
1662
-
1663
- // Check both live and hot archive buckets for hash. If we don't
1664
- // find it in either, we're missing a bucket. Note that live and
1665
- // hot archive buckets are guaranteed to have no hash collisions
1666
- // due to type field in MetaEntry.
1667
- if (!hot)
1668
- {
1669
- throw std::runtime_error (
1670
- fmt::format (FMT_STRING (" Missing referenced bucket {}" ),
1671
- binToHex (h)));
1672
- }
1673
- return std::make_tuple (hot->getFilename ().string (),
1674
- hot->getHash (), true );
1675
- }
1676
- else
1652
+ auto maybeLiveBucket = getBucketByHashInternal (h, mSharedLiveBuckets );
1653
+ if (!maybeLiveBucket)
1654
+ {
1655
+ auto hotBucket =
1656
+ getBucketByHashInternal (h, mSharedHotArchiveBuckets );
1657
+
1658
+ // Check both live and hot archive buckets for hash. If we don't
1659
+ // find it in either, we're missing a bucket. Note that live and
1660
+ // hot archive buckets are guaranteed to have no hash collisions
1661
+ // due to type field in MetaEntry.
1662
+ if (!hotBucket)
1677
1663
{
1678
- return std::make_tuple (live-> getFilename (). string (),
1679
- live-> getHash ( ), false );
1664
+ throw std::runtime_error ( fmt::format (
1665
+ FMT_STRING ( " Missing referenced bucket {} " ), binToHex (h)) );
1680
1666
}
1681
- };
1682
-
1683
- auto [filename, hash, isHot] = loadFilenameAndHash ();
1684
1667
1685
- if (isHot)
1686
- {
1668
+ auto filename = hotBucket-> getFilename (). string ();
1669
+ auto hash = hotBucket-> getHash ();
1687
1670
auto [indexIter, _] = hotIndexMap.emplace (i++, nullptr );
1671
+
1688
1672
seq.emplace_back (
1689
1673
std::make_shared<VerifyBucketWork<HotArchiveBucket>>(
1690
1674
mApp , filename, hash, indexIter->second , nullptr ));
1691
1675
}
1692
1676
else
1693
1677
{
1678
+ auto filename = maybeLiveBucket->getFilename ().string ();
1679
+ auto hash = maybeLiveBucket->getHash ();
1694
1680
auto [indexIter, _] = liveIndexMap.emplace (i++, nullptr );
1681
+
1695
1682
seq.emplace_back (std::make_shared<VerifyBucketWork<LiveBucket>>(
1696
1683
mApp , filename, hash, indexIter->second , nullptr ));
1697
1684
}
0 commit comments