Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

indexer-alt: configure consistency retention in one place #20889

Merged
merged 1 commit into from
Jan 15, 2025

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Jan 15, 2025

Description

Add back a dedicated top-level configuration for consistency, to control the retention of the consistent range. Now that this range is controlled by the pruner, it can be configured by a PrunerConfig as well, rather than a dedicated ConsistencyConfig.

The motivation for this is that the E2E testing setup needs to configure the consistent range, and it would be better to avoid having to enumerate all the consistent pipelines in the test harness because it would be easy to forget to update that list, whereas with this approach, we take advantage of the fact that there is an add_consistent macro to register the pipeline, and it will do the right thing.

Test plan

sui$ cargo check
sui$ cargo nextest run -p sui-indexer-alt
sui$ cargo run -p sui-indexer-alt -- generate-config

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:
  • JSON-RPC:
  • GraphQL:
  • CLI:
  • Rust SDK:

## Description

Add back a dedicated top-level configuration for consistency, to control
the retention of the consistent range. Now that this range is controlled
by the pruner, it can be configured by a `PrunerConfig` as well, rather
than a dedicated `ConsistencyConfig`.

The motivation for this is that the E2E testing setup needs to configure
the consistent range, and it would be better to avoid having to
enumerate all the consistent pipelines in the test harness because it
would be easy to forget to update that list, whereas with this approach,
we take advantage of the fact that there is an `add_consistent` macro to
register the pipeline, and it will do the right thing.

## Test plan

```
sui$ cargo check
sui$ cargo nextest run -p sui-indexer-alt
sui$ cargo run -p sui-indexer-alt -- generate-config
```
@amnn amnn self-assigned this Jan 15, 2025
Copy link

vercel bot commented Jan 15, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Jan 15, 2025 0:03am
sui-kiosk ⬜️ Ignored (Inspect) Jan 15, 2025 0:03am

@amnn amnn temporarily deployed to sui-typescript-aws-kms-test-env January 15, 2025 12:03 — with GitHub Actions Inactive
This was referenced Jan 15, 2025
Copy link
Contributor

@wlmyng wlmyng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After looking at https://github.com/MystenLabs/sui-operations/pull/4795/files does that mean other pipelines that want pruning will do

[consistency]
retention = 3600

instead of

[pruner]
retention = 3600

[pipeline.coin_balance_buckets.pruner]

Or will we end up with two ways to essentially configure pruning?

What does the e2e testing setup look like w.r.t configuring the consistent range?

@amnn
Copy link
Contributor Author

amnn commented Jan 15, 2025

The [consistency] config is just for consistent pipelines. If you want to enable pruning for just one pipeline, I would probably recommend something like:

[pipeline.foo.pruner]
retention = ...

The top-level [pruner] config is used to provide a common default pruning configuration that is shared among all pipelines that you enable pruning for:

[consistency]
retention = 41

[pruner]
retention = 42

[pipeline.bar.pruner]

[pipeline.baz.pruner]

[pipeline.qux.pruner]
retention = 43

In the example above, the consistent pipelines will all get retention 41 (you don't need to explicitly enable pruning for them because it doesn't make sense to run them without pruning), bar and baz have pruning enabled and they will prune with a retention of 42, and qux has pruning enabled and will prune with a retention of 43. Any other pipeline that could be pruned, will not, because you haven't enabled pruning for it.

It's unlikely that you would create a config this complex in practice though -- the idea is that sometimes you want to configure one retention for all pipelines being configured, sometimes you want to configure them individually, and for consistent pipelines, you don't want the choice -- they need to be the same.

While we're talking about the ops PR, could you take a look at that as well? I'd love to be able to land this PR and that one together.

@amnn amnn merged commit a46f697 into main Jan 15, 2025
51 checks passed
@amnn amnn deleted the amnn/idx-consistency branch January 15, 2025 20:26
ronny-mysten pushed a commit to ronny-mysten/sui that referenced this pull request Jan 15, 2025
…#20889)

## Description

Add back a dedicated top-level configuration for consistency, to control
the retention of the consistent range. Now that this range is controlled
by the pruner, it can be configured by a `PrunerConfig` as well, rather
than a dedicated `ConsistencyConfig`.

The motivation for this is that the E2E testing setup needs to configure
the consistent range, and it would be better to avoid having to
enumerate all the consistent pipelines in the test harness because it
would be easy to forget to update that list, whereas with this approach,
we take advantage of the fact that there is an `add_consistent` macro to
register the pipeline, and it will do the right thing.

## Test plan

```
sui$ cargo check
sui$ cargo nextest run -p sui-indexer-alt
sui$ cargo run -p sui-indexer-alt -- generate-config
```

---

## 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:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants