Skip to content

Commit

Permalink
storage: in feedback upsert, only process relevant updates/commands
Browse files Browse the repository at this point in the history
  • Loading branch information
aljoscha committed Jan 9, 2025
1 parent 5215d48 commit 3128ce9
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/storage/src/upsert_continual_feedback.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,29 @@ where

eligible
})
.filter(|(ts, _, _, _)| {
let persist_upper = match &drain_style {
DrainStyle::ToUpper {
input_upper: _,
persist_upper,
} => persist_upper,
DrainStyle::AtTime {
time: _,
persist_upper,
} => persist_upper,
};

// Any update that is "in the past" of the persist upper is not
// relevant anymore. We _can_ emit changes for it, but the
// downstream persist_sink would filter these updates out because
// the shard upper is already further ahead.
//
// Plus, our upsert state is up-to-date to the persist_upper, so we
// wouldn't be able to emit correct retractions for incoming
// commands whose `ts` is in the past of that.
let relevant = persist_upper.less_equal(ts);
relevant
})
.collect_vec();

tracing::debug!(
Expand Down

0 comments on commit 3128ce9

Please sign in to comment.