Skip to content

Commit

Permalink
dont need commit after state persisted
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Jan 23, 2024
1 parent 2e49bb5 commit a4968e9
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/stream/src/executor/backfill/arrangement_backfill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ where
// If not finished then we need to update state, otherwise no need.
if let Message::Barrier(barrier) = &msg {
if is_completely_finished {
// If already finished, no need to persist any state.
} else {
// If snapshot was empty, we do not need to backfill,
// but we still need to persist the finished state.
Expand Down Expand Up @@ -492,20 +493,16 @@ where
}
}

tracing::trace!(
"Arrangement Backfill has already finished and forward messages directly to the downstream"
);

// After progress finished + state persisted,
// we can forward messages directly to the downstream,
// as backfill is finished.
#[for_await]
for msg in upstream {
if let Some(msg) = mapping_message(msg?, &self.output_indices) {
tracing::trace!(
actor = self.actor_id,
message = ?msg,
"backfill_finished_after_barrier"
);
if let Message::Barrier(barrier) = &msg {
self.state_table.commit_no_data_expected(barrier.epoch);
}
yield msg;
}
}
Expand Down

0 comments on commit a4968e9

Please sign in to comment.