@@ -1079,15 +1079,17 @@ BucketManager::startBackgroundEvictionScan(uint32_t ledgerSeq,
1079
1079
mSnapshotManager ->copySearchableLiveBucketListSnapshot ();
1080
1080
auto const & sas = cfg.stateArchivalSettings ();
1081
1081
1082
- using task_t = std::packaged_task<EvictionResultCandidates ()>;
1082
+ using task_t =
1083
+ std::packaged_task<std::unique_ptr<EvictionResultCandidates>()>;
1083
1084
// MSVC gotcha: searchableBL has to be shared_ptr because MSVC wants to
1084
1085
// copy this lambda, otherwise we could use unique_ptr.
1085
1086
auto task = std::make_shared<task_t >(
1086
1087
[bl = std::move (searchableBL), iter = cfg.evictionIterator (), ledgerSeq,
1087
1088
ledgerVers, sas, &counters = mBucketListEvictionCounters ,
1088
1089
stats = mEvictionStatistics ] {
1089
- return bl->scanForEviction (ledgerSeq, counters, iter, stats, sas,
1090
- ledgerVers);
1090
+ return std::make_unique<EvictionResultCandidates>(
1091
+ bl->scanForEviction (ledgerSeq, counters, iter, stats, sas,
1092
+ ledgerVers));
1091
1093
});
1092
1094
1093
1095
mEvictionFuture = task->get_future ();
@@ -1114,14 +1116,14 @@ BucketManager::resolveBackgroundEvictionScan(
1114
1116
1115
1117
// If eviction related settings changed during the ledger, we have to
1116
1118
// restart the scan
1117
- if (!evictionCandidates. isValid (ledgerSeq,
1119
+ if (!evictionCandidates-> isValid (ledgerSeq, ledgerVers ,
1118
1120
networkConfig.stateArchivalSettings ()))
1119
1121
{
1120
1122
startBackgroundEvictionScan (ledgerSeq, ledgerVers, networkConfig);
1121
1123
evictionCandidates = mEvictionFuture .get ();
1122
1124
}
1123
1125
1124
- auto & eligibleEntries = evictionCandidates. eligibleEntries ;
1126
+ auto & eligibleEntries = evictionCandidates-> eligibleEntries ;
1125
1127
1126
1128
for (auto iter = eligibleEntries.begin (); iter != eligibleEntries.end ();)
1127
1129
{
@@ -1139,7 +1141,7 @@ BucketManager::resolveBackgroundEvictionScan(
1139
1141
auto remainingEntriesToEvict =
1140
1142
networkConfig.stateArchivalSettings ().maxEntriesToArchive ;
1141
1143
auto entryToEvictIter = eligibleEntries.begin ();
1142
- auto newEvictionIterator = evictionCandidates. endOfRegionIterator ;
1144
+ auto newEvictionIterator = evictionCandidates-> endOfRegionIterator ;
1143
1145
1144
1146
// Return vectors include both evicted entry and associated TTL
1145
1147
std::vector<LedgerKey> deletedKeys;
@@ -1179,7 +1181,7 @@ BucketManager::resolveBackgroundEvictionScan(
1179
1181
// region
1180
1182
if (remainingEntriesToEvict != 0 )
1181
1183
{
1182
- newEvictionIterator = evictionCandidates. endOfRegionIterator ;
1184
+ newEvictionIterator = evictionCandidates-> endOfRegionIterator ;
1183
1185
}
1184
1186
1185
1187
networkConfig.updateEvictionIterator (ltx, newEvictionIterator);
0 commit comments