Skip to content

Commit 11ad34b

Browse files
author
Eric Fu
authored
fix(metadata v2): existing actor splits were not updated (#18553)
1 parent 9167768 commit 11ad34b

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

src/meta/src/controller/streaming_job.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ impl CatalogController {
14471447
.exec(&txn)
14481448
.await?;
14491449

1450+
// add new actors
14501451
for (
14511452
PbStreamActor {
14521453
actor_id,
@@ -1554,6 +1555,23 @@ impl CatalogController {
15541555
actor.update(&txn).await?;
15551556
}
15561557

1558+
// Update actor_splits for existing actors
1559+
for (actor_id, splits) in actor_splits {
1560+
if new_created_actors.contains(&(actor_id as ActorId)) {
1561+
continue;
1562+
}
1563+
1564+
let actor = Actor::find_by_id(actor_id as ActorId)
1565+
.one(&txn)
1566+
.await?
1567+
.ok_or_else(|| MetaError::catalog_id_not_found("actor", actor_id))?;
1568+
1569+
let mut actor = actor.into_active_model();
1570+
let splits = splits.iter().map(PbConnectorSplit::from).collect_vec();
1571+
actor.splits = Set(Some((&PbConnectorSplits { splits }).into()));
1572+
actor.update(&txn).await?;
1573+
}
1574+
15571575
// fragment update
15581576
let fragment = Fragment::find_by_id(fragment_id)
15591577
.one(&txn)

0 commit comments

Comments
 (0)