Skip to content

Commit 934a478

Browse files
committed
fix(pipeline): rw transaction deadlock
1 parent 54daefb commit 934a478

File tree

1 file changed

+5
-6
lines changed
  • crates/sync/pipeline/src

1 file changed

+5
-6
lines changed

crates/sync/pipeline/src/lib.rs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -470,11 +470,10 @@ impl Pipeline {
470470
let span = info_span!(target: "pipeline", "stage.prune", stage = %id);
471471
let enter = span.entered();
472472

473-
let provider_mut = self.storage_provider.provider_mut();
474-
475473
// Get execution checkpoint (tip for this stage) and prune checkpoint
476-
let execution_checkpoint = provider_mut.execution_checkpoint(id)?;
477-
let prune_checkpoint = provider_mut.prune_checkpoint(id)?;
474+
let execution_checkpoint =
475+
self.storage_provider.provider_mut().execution_checkpoint(id)?;
476+
let prune_checkpoint = self.storage_provider.provider_mut().prune_checkpoint(id)?;
478477

479478
let Some(tip) = execution_checkpoint else {
480479
info!(target: "pipeline", "Skipping stage - no data to prune (no execution checkpoint).");
@@ -500,11 +499,11 @@ impl Pipeline {
500499
// Update prune checkpoint to the last pruned block (range.end - 1 since range is
501500
// exclusive)
502501
if range.end > 0 {
502+
let provider_mut = self.storage_provider.provider_mut();
503503
provider_mut.set_prune_checkpoint(id, range.end - 1)?;
504+
provider_mut.commit()?;
504505
}
505506

506-
provider_mut.commit()?;
507-
508507
let _enter = span_inner.enter();
509508
info!(target: "pipeline", %pruned_count, "Stage pruning completed.");
510509
}

0 commit comments

Comments
 (0)