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] pruning tests #20744

Open
wants to merge 3 commits into
base: indexer-alt-prune-impls
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/sui-indexer-alt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ sui-synthetic-ingestion = { workspace = true, optional = true }
rand.workspace = true
tempfile.workspace = true
wiremock.workspace = true
simulacrum.workspace = true

[features]
default = []
Expand Down
1 change: 1 addition & 0 deletions crates/sui-indexer-alt/src/benchmark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ pub async fn run_benchmark(
client_args,
indexer_config,
false, /* with_genesis */
None,
)
.await?;

Expand Down
3 changes: 2 additions & 1 deletion crates/sui-indexer-alt/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ pub async fn start_indexer(
// TODO: There is probably a better way to handle this.
// For instance, we could also pass in dummy genesis data in the benchmark mode.
with_genesis: bool,
cancel: Option<CancellationToken>,
) -> anyhow::Result<()> {
let IndexerConfig {
ingestion,
Expand Down Expand Up @@ -88,7 +89,7 @@ pub async fn start_indexer(
let committer = committer.finish(CommitterConfig::default());
let pruner = pruner.finish(PrunerConfig::default());

let cancel = CancellationToken::new();
let cancel = cancel.unwrap_or_else(CancellationToken::new);
let retry_interval = ingestion.retry_interval();

let mut indexer = Indexer::new(
Expand Down
1 change: 1 addition & 0 deletions crates/sui-indexer-alt/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ async fn main() -> Result<()> {
client_args,
indexer_config,
true,
None,
)
.await?;
}
Expand Down
5 changes: 5 additions & 0 deletions crates/sui-indexer-alt/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

#[cfg(test)]
mod pruning;
12 changes: 12 additions & 0 deletions crates/sui-indexer-alt/tests/pruning/configs/base_config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[ingestion]
checkpoint-buffer-size = 10
ingestion-concurrency = 2
retry-interval-ms = 200

[consistency]
consistent-range = 10

[committer]
write-concurrency = 2
collect-interval-ms = 500
watermark-interval-ms = 500
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[pipeline.cp_sequence_numbers]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pipeline.kv_checkpoints.pruner]
interval-ms = 200
delay-ms = 100
retention = 1
max-chunk-size = 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pipeline.kv_epoch_starts.pruner]
interval-ms = 200
delay-ms = 100
retention = 1
max-chunk-size = 1
5 changes: 5 additions & 0 deletions crates/sui-indexer-alt/tests/pruning/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0

#[cfg(test)]
pub(crate) mod pruner_tests;
Loading
Loading