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] Temporarily remove transaction in sequential pipeline #20394

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
16 changes: 15 additions & 1 deletion crates/sui-indexer-alt/src/pipeline/sequential/committer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use std::{cmp::Ordering, collections::BTreeMap, sync::Arc};

use diesel_async::{scoped_futures::ScopedFutureExt, AsyncConnection};
//use diesel_async::{scoped_futures::ScopedFutureExt, AsyncConnection};
use mysten_metrics::spawn_monitored_task;
use tokio::{
sync::mpsc,
Expand Down Expand Up @@ -226,6 +226,19 @@ pub(super) fn committer<H: Handler + 'static>(
continue;
};

// TODO: The following code is an experiment to see whether it makes
// a difference to the commit throughput if we do not use a transaction.
// It can lead to inconsistent state for live queries, as well as
// inaccurate affected row counts in case of watermark update failure.
// Remove it later.
let affected = match H::commit(&batch, &mut conn).await {
Ok(affected) => {
watermark.update(&mut conn).await.map(|_| affected).map_err(|e| e.into())
}
e => e,
};

/*
// Write all the object updates out along with the watermark update, in a
// single transaction. The handler's `commit` implementation is responsible for
// chunking up the writes into a manageable size.
Expand All @@ -235,6 +248,7 @@ pub(super) fn committer<H: Handler + 'static>(
watermark.update(conn).await?;
H::commit(&batch, conn).await
}.scope_boxed()).await;
*/

// Drop the connection eagerly to avoid it holding on to references borrowed by
// the transaction closure.
Expand Down
Loading