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

fix(frontend): only use arrangement backfill for non-singleton upstream #15930

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
7 changes: 7 additions & 0 deletions src/frontend/src/optimizer/plan_node/stream_table_scan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,13 @@ impl StreamTableScan {
None => Distribution::SomeShard,
}
};
// For single distribution, we can't use arrangement backfill.
let stream_scan_type = match stream_scan_type {
StreamScanType::ArrangementBackfill if distribution == Distribution::Single => {
StreamScanType::Backfill
}
_ => stream_scan_type,
};

let base = PlanBase::new_stream_with_core(
&core,
Expand Down
5 changes: 5 additions & 0 deletions src/stream/src/common/table/state_table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,11 @@ where
pk_indices.iter().position(|&i| vnode_col_idx == i)
});

// Upstream must have dist_key_in_pk_indices, otherwise that means it is singleton distribution,
// and it should use `no_shuffle_backfill` instead.
if IS_REPLICATED && is_consistent_op {
assert!(!dist_key_in_pk_indices.is_empty());
}
let distribution =
TableDistribution::new(vnodes, dist_key_in_pk_indices, vnode_col_idx_in_pk);

Expand Down
Loading