Skip to content

Commit

Permalink
indexer-alt: --skip-watermark
Browse files Browse the repository at this point in the history
## Description

Add a flag to skip writing to the watermark table. This would be useful
when an indexer is running in parallel with another indexer and it's
just not even productive to try writing to the watermarks table, because
it will always be behind.

## Test plan

Tested locally.
  • Loading branch information
amnn committed Oct 18, 2024
1 parent eb821d3 commit e8eea21
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion crates/sui-indexer-alt/src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ pub struct CommitterConfig {
value_parser = |s: &str| s.parse().map(Duration::from_millis),
)]
commit_interval: Duration,

/// Avoid writing to the watermark table
#[arg(long)]
skip_watermark: bool,
}

/// A batch of processed values associated with a single checkpoint. This is an internal type used
Expand Down Expand Up @@ -540,7 +544,7 @@ fn committer<H: Handler + 'static>(
"Gathered watermarks",
);

if watermark_needs_update {
if !config.skip_watermark && watermark_needs_update {
let guard = metrics
.watermark_commit_latency
.with_label_values(&[H::NAME])
Expand Down

0 comments on commit e8eea21

Please sign in to comment.