Commit 75e461e
authored
[indexer-alt-framework] watermark tasks (#23737)
## Description
Building on #24192, we now have
new fields `--task` and `--reader-interval-ms`, which when set creates
an indexer whose pipelines commit checkpoint data as long as it is not
less than each of its main pipeline's `pruner_hi`.
Startup behavior remains the same as defined in the previous PR: all
pipelines, tasked or not, will resume committing from next after its
committer watermark, or expect 0, unless overridden by
`--first-checkpoint`.
The indexer determines ingestion as the smallest next checkpoint across
pipelines (as calculated above.)
To backfill, operators either:
- run a new indexer with `-task` and `-first-checkpoint` (preferred), or
- wipe watermark entries for main pipelines (without task) and restart
main indexer with `-first-checkpoint.`
Multiple tasked indexers can run in parallel with different ranges to
accelerate backfill.
## Test plan
New tests in `lib.rs` and `collector.rs`
Additional tests in `collector`
---
## Release notes
Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.
For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.
- [ ] Protocol:
- [ ] Nodes (Validators and Full nodes):
- [ ] gRPC:
- [x] JSON-RPC:
This PR, in tandem
with [https://github.com/MystenLabs/sui/pull/24192](https://github.com/MystenLabs/sui/pull/24192),
unifies how indexers determine their ingestion starting point and
introduce watermark-gated backfill tasks.
1. `--skip-watermark` is removed, and the previous ability to bypass
watermark safety checks for concurrent pipelines is no longer supported.
2. `--first-checkpoint` no longer forces the indexer to start ingesting
from the configured checkpoint. The indexer now always determines its
starting ingestion point as the minimum next checkpoint across all
pipelines to resume processing from. From this release,
`--first-checkpoint` now only applies to pipelines that do not yet have
a committer watermark. These pipelines will resume processing from the
configured value. Pipelines with existing watermarks will always resume
processing from their own next checkpoint.
3. A new mechanism, watermark tasks, allows operators to run the same
pipelines on multiple indexer instances for historical backfilling. Two
new flags, `--task` and `--reader-interval-ms`, enable this mechanism.
These flags create a tasked indexer whose pipelines commit checkpoint
data as long as the checkpoint is not below the `reader_lo` watermark of
their corresponding main pipelines. The indexer controls how frequently
these tasked pipelines poll the main pipelines' watermarks
per `--reader-interval-ms`.
Migration guidance:
1. If you use `--first-checkpoint` only for _initial_ ingestion of a
fresh pipeline, no further action is needed.
2. If you previously used `--first-checkpoint` and
optionally `--skip-watermark` to backfill existing tables, you can
achieve the same workflow by starting a new indexer instance with a
configured `--task`, `--reader-interval-ms`, and `--first-checkpoint`.
3. Like `--skip-watermark`, `--task` cannot be used to run sequential
pipelines.
- [x] GraphQL:
See above
- [ ] CLI:
- [ ] Rust SDK:1 parent 838a94e commit 75e461e
File tree
16 files changed
+1048
-115
lines changed- crates
- sui-checkpoint-blob-indexer/src
- sui-indexer-alt-consistent-store/src/store
- sui-indexer-alt-framework-store-traits/src
- sui-indexer-alt-framework/src
- ingestion
- mocks
- pipeline
- concurrent
- sui-indexer-alt-object-store/src
- sui-indexer-alt/src
- sui-pg-db/src
16 files changed
+1048
-115
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| |||
161 | 161 | | |
162 | 162 | | |
163 | 163 | | |
164 | | - | |
| 164 | + | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
170 | 175 | | |
171 | | - | |
| 176 | + | |
172 | 177 | | |
173 | 178 | | |
174 | | - | |
| 179 | + | |
175 | 180 | | |
176 | 181 | | |
177 | 182 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | | - | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
39 | | - | |
40 | | - | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | | - | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
66 | | - | |
| 71 | + | |
67 | 72 | | |
68 | 73 | | |
69 | 74 | | |
| |||
81 | 86 | | |
82 | 87 | | |
83 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
84 | 93 | | |
85 | 94 | | |
86 | 95 | | |
| |||
179 | 188 | | |
180 | 189 | | |
181 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
182 | 212 | | |
183 | 213 | | |
184 | 214 | | |
| |||
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
217 | 217 | | |
218 | 218 | | |
219 | 219 | | |
220 | | - | |
| 220 | + | |
221 | 221 | | |
222 | 222 | | |
223 | 223 | | |
| |||
238 | 238 | | |
239 | 239 | | |
240 | 240 | | |
241 | | - | |
242 | | - | |
| 241 | + | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
0 commit comments