risingwave_stream::executor::backfill::utils

Function normalize_unmatched_updates

source
fn normalize_unmatched_updates(
    normalized_ops: &mut Cow<'_, [Op]>,
    unmatched_update_delete: &mut bool,
    visible_update_delete: &mut bool,
    current_visibility: bool,
    current_op_index: usize,
    current_op: &Op,
)
Expand description

We will rewrite unmatched U-/U+ into +/- ops. They can be unmatched because while they will always have the same stream key, their storage pk might be different. Here we use storage pk (current_pos) to filter them, as such, a U+ might be filtered out, but their corresponding U- could be kept, and vice versa.

This hanging U-/U+ can lead to issues downstream, since we work with an assumption in the system that there’s never hanging U-/U+.