Skip to content

Commit

Permalink
only notify internal tables
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Oct 17, 2024
1 parent 4685f5a commit eb9552d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 17 deletions.
15 changes: 3 additions & 12 deletions src/meta/src/controller/streaming_job.rs
Original file line number Diff line number Diff line change
Expand Up @@ -367,21 +367,12 @@ impl CatalogController {
Ok(table_id_map)
}

pub async fn pre_notify_relations_for_mv(
&self,
job: &StreamingJob,
internal_tables: &[PbTable],
) -> MetaResult<()> {
let StreamingJob::MaterializedView(table) = job else {
return Ok(());
};

let tables = std::iter::once(table).chain(internal_tables);

pub async fn pre_notify_internal_tables(&self, internal_tables: &[PbTable]) -> MetaResult<()> {
self.notify_frontend(
Operation::Add,
Info::RelationGroup(RelationGroup {
relations: tables
relations: internal_tables
.iter()
.map(|table| Relation {
relation_info: Some(RelationInfo::Table(table.clone())),
})
Expand Down
12 changes: 7 additions & 5 deletions src/meta/src/rpc/ddl_controller_v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,14 @@ impl DdlController {
let streaming_job = &ctx.streaming_job;
let internal_tables = ctx.internal_tables();

// Now that all fields in `streaming_job` and `internal_tables` are initialized,
// Now that all fields in `internal_tables` are initialized,
// we can notify frontend for these relations.
self.metadata_manager
.catalog_controller
.pre_notify_relations_for_mv(streaming_job, &internal_tables)
.await?;
if streaming_job.is_materialized_view() {
self.metadata_manager
.catalog_controller
.pre_notify_internal_tables(&internal_tables)
.await?;
}

match streaming_job {
StreamingJob::Table(None, table, TableJobType::SharedCdcSource) => {
Expand Down

0 comments on commit eb9552d

Please sign in to comment.