1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
//! What `max_objects` meters, and what a pass does when it runs out.
use GcConfig;
/// The work one garbage-collection pass is allowed to do.
///
/// One unit is one object the pass reads or decides on a candidate's
/// behalf:
///
/// * one enumerated candidate key, decided — the original meaning of
/// `max_objects`;
/// * one manifest opened by the content reference scan;
/// * one page of revision rows read out of an opened manifest;
/// * one retained WAL segment fetched by the scan.
///
/// Prefix listing is the one thing not metered: it is how a family finds
/// candidates at all, and the cursor is what resumes it. Everything else a
/// pass touches is charged, so no pass can do work proportional to the
/// namespace while asking for a small budget.
///
/// The rule is deliberately coarse — it is a bound, not a cost model. A
/// page of rows costs more than a manifest header and both count as one.
/// What matters is that every store round trip inside the pass has a
/// charge attached to it, and that running out stops the pass instead of
/// letting it finish "just this one thing" unboundedly.