Skip to content

Commit 8e7b826

Browse files
committed
Minor bucket manager cleanup
1 parent d88c58f commit 8e7b826

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/bucket/BucketManager.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -1047,15 +1047,15 @@ BucketManager::maybeSetIndex(std::shared_ptr<BucketBase> b,
10471047
}
10481048

10491049
void
1050-
BucketManager::startBackgroundEvictionScan(uint32_t ledgerSeq)
1050+
BucketManager::startBackgroundEvictionScan(uint32_t ledgerSeq,
1051+
SorobanNetworkConfig const& cfg)
10511052
{
10521053
releaseAssert(mSnapshotManager);
10531054
releaseAssert(!mEvictionFuture.valid());
10541055
releaseAssert(mEvictionStatistics);
10551056

10561057
auto searchableBL =
10571058
mSnapshotManager->copySearchableLiveBucketListSnapshot();
1058-
auto const& cfg = mApp.getLedgerManager().getSorobanNetworkConfig();
10591059
auto const& sas = cfg.stateArchivalSettings();
10601060

10611061
using task_t = std::packaged_task<EvictionResult()>;
@@ -1084,7 +1084,7 @@ BucketManager::resolveBackgroundEvictionScan(
10841084

10851085
if (!mEvictionFuture.valid())
10861086
{
1087-
startBackgroundEvictionScan(ledgerSeq);
1087+
startBackgroundEvictionScan(ledgerSeq, networkConfig);
10881088
}
10891089

10901090
auto evictionCandidates = mEvictionFuture.get();
@@ -1094,7 +1094,7 @@ BucketManager::resolveBackgroundEvictionScan(
10941094
if (!evictionCandidates.isValid(ledgerSeq,
10951095
networkConfig.stateArchivalSettings()))
10961096
{
1097-
startBackgroundEvictionScan(ledgerSeq);
1097+
startBackgroundEvictionScan(ledgerSeq, networkConfig);
10981098
evictionCandidates = mEvictionFuture.get();
10991099
}
11001100

src/bucket/BucketManager.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,8 @@ class BucketManager : NonMovableOrCopyable
298298
// Scans BucketList for non-live entries to evict starting at the entry
299299
// pointed to by EvictionIterator. Evicts until `maxEntriesToEvict` entries
300300
// have been evicted or maxEvictionScanSize bytes have been scanned.
301-
void startBackgroundEvictionScan(uint32_t ledgerSeq);
301+
void startBackgroundEvictionScan(uint32_t ledgerSeq,
302+
SorobanNetworkConfig const& cfg);
302303
void resolveBackgroundEvictionScan(AbstractLedgerTxn& ltx,
303304
uint32_t ledgerSeq,
304305
LedgerKeySet const& modifiedKeys,

src/ledger/LedgerManagerImpl.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1056,7 +1056,8 @@ LedgerManagerImpl::closeLedger(LedgerCloseData const& ledgerData,
10561056
// Step 4
10571057
if (protocolVersionStartsFrom(initialLedgerVers, SOROBAN_PROTOCOL_VERSION))
10581058
{
1059-
mApp.getBucketManager().startBackgroundEvictionScan(ledgerSeq + 1);
1059+
mApp.getBucketManager().startBackgroundEvictionScan(
1060+
ledgerSeq + 1, getSorobanNetworkConfig());
10601061
}
10611062

10621063
// Invoke completion handler on the _main_ thread: kick off publishing,

0 commit comments

Comments
 (0)