File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
src/Database/LSMTree/Internal Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -959,6 +959,8 @@ supplyCredits conf deposit levels =
959959 -- supplyCreditsIncomingRun could easily return the supplied credits
960960 -- before & after, which may be useful for tracing.
961961
962+ -- | See 'maxPhysicalDebt' in 'newLevelMerge' in the 'ScheduledMerges'
963+ -- prototype.
962964maxMergeDebt :: TableConfig -> MergePolicyForLevel -> LevelNo -> MergeDebt
963965maxMergeDebt TableConfig {
964966 confWriteBufferAlloc = AllocNumEntries (NumEntries -> bufferSize),
@@ -968,16 +970,13 @@ maxMergeDebt TableConfig {
968970 case mergePolicy of
969971 LevelLevelling ->
970972 MergeDebt . MergeCredits $
971- sizeRatio * maxRunSizeTiering sizeRatio bufferSize ( pred ln)
973+ sizeRatio * maxRunSizeTiering sizeRatio bufferSize ln
972974 + maxRunSizeLevelling sizeRatio bufferSize ln
973975
974976 LevelTiering ->
975977 MergeDebt . MergeCredits $
976- maxRuns * maxRunSizeTiering sizeRatio bufferSize (pred ln)
977- where
978- -- We can hold back underfull runs, so sometimes the are n+1 runs,
979- -- rather than the typical n at a tiering level (n = LSM size ratio).
980- maxRuns = sizeRatio + 1
978+ sizeRatio * maxRunSizeTiering sizeRatio bufferSize ln
979+ + maxRunSizeTiering sizeRatio bufferSize (pred ln)
981980
982981-- | The nominal debt equals the minimum of credits we will supply before we
983982-- expect the merge to complete. This is the same as the number of updates
You can’t perform that action at this time.
0 commit comments