diff --git a/src/frontend/src/handler/alter_table_column.rs b/src/frontend/src/handler/alter_table_column.rs index 4fd624929a175..e9ecb5713cb10 100644 --- a/src/frontend/src/handler/alter_table_column.rs +++ b/src/frontend/src/handler/alter_table_column.rs @@ -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, @@ -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)) } diff --git a/src/meta/src/rpc/ddl_controller.rs b/src/meta/src/rpc/ddl_controller.rs index 5550537021ca4..56e8edbf1d780 100644 --- a/src/meta/src/rpc/ddl_controller.rs +++ b/src/meta/src/rpc/ddl_controller.rs @@ -2160,8 +2160,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,