Skip to content

Commit

Permalink
replace table keep vnode count
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <i@bugenzhao.com>
  • Loading branch information
BugenZhao committed Sep 20, 2024
1 parent 859b7de commit 0d6830b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion src/frontend/src/handler/alter_table_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub async fn get_replace_table_plan(
panic!("unexpected statement type: {:?}", definition);
};

let (mut graph, mut table, source, job_type) = generate_stream_graph_for_table(
let (mut graph, table, source, job_type) = generate_stream_graph_for_table(
session,
table_name,
original_catalog,
Expand Down Expand Up @@ -241,7 +241,10 @@ pub async fn get_replace_table_plan(
)?;
}

// Set some fields ourselves so that the meta service does not need to maintain them.
let mut table = table;
table.incoming_sinks = incoming_sink_ids.iter().copied().collect();
table.maybe_vnode_count = Some(original_catalog.vnode_count() as _);

Ok((source, table, graph, col_index_mapping, job_type))
}
Expand Down
4 changes: 2 additions & 2 deletions src/meta/src/rpc/ddl_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2149,8 +2149,8 @@ impl DdlController {
old_table_fragments.assigned_parallelism,
);

// TODO(var-vnode): fill vnode count for table catalog in `stream_job`,
// like what we do in `build_stream_job`.
// Note: no need to set `vnode_count` as it's already set by the frontend.
// See `get_replace_table_plan`.

let ctx = ReplaceTableContext {
old_table_fragments,
Expand Down

0 comments on commit 0d6830b

Please sign in to comment.