Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
indexer-alt: sequential pipeline (#20053)
## Description Introduce a new kind of pipeline for indexing that needs commit data in checkpoint order. This will be used for indexing data that would previously have gone into `objects` or `objects_snapshot`, where rows are modified in place, and so can't be committed out-of-order. Sequential pipelines are split into two parts: - A `processor` which is shared with the existing concurrent pipeline, and is responsible for turning checkpoint data into values to be sent to the database. - A `committer` which is responsible for batching up prefixes of updates and sending them to the DB when they are complete (no gaps between the last write and what has been buffered). The key design constraints of the sequential pipeline are as follows: - Although the committer must write out rows in order, it can buffer the results of checkpoint processed out-of-order. - It uses the ingestion service's regulator for back-pressure: The ingestion service is only allowed to run ahead of all sequential pipelines by its buffer size, which bounds the memory that each pipeline must use to buffer pending writes. - Sequential pipelines have different tuning parameters compared to concurrent pipelines: - `MIN_BATCH_ROWS`: The threshold for eagerly writing to the DB. - `MAX_BATCH_CHECKPOINTS`: The maximum number of checkpoints that will be batched together in a single transaction. - They guarantee atomicity using DB transactions: All the writes for a single checkpoint, and the corresponding watermark update are put into the same DB transaction. - They support simplifying/merging writes to the DB: If the same object is modified multiple times across multiple checkpoints, only the latest write will make it to the DB. ## Test plan This change is primarily tested by the `sum_obj_types` pipeline introduced in the next change. ## Stack - #20050 - #20051 - #20052 --- ## 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): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK: - [ ] REST API:
- Loading branch information