topology: drop manager-root special case + notify three agents on reparent (#743)
This commit is contained in:
parent
9884ac013d
commit
2c3b62be55
4 changed files with 139 additions and 20 deletions
|
|
@ -187,13 +187,15 @@ async fn dispatch(req: &HostRequest, coord: Arc<Coordinator>) -> HostResponse {
|
|||
}
|
||||
HostRequest::SetParent { child, new_parent } => {
|
||||
tracing::info!(%child, ?new_parent, "set_parent");
|
||||
crate::topology::set_parent(child, new_parent.as_deref())
|
||||
// `reparent_with_notify` wraps `topology::set_parent`
|
||||
// with the three notification messages (#743) + the
|
||||
// ContainerView rescan. Idempotent same-parent calls
|
||||
// skip both the messages and the disk write per the
|
||||
// topology fast-path.
|
||||
coord
|
||||
.reparent_with_notify(child, new_parent.as_deref())
|
||||
.await
|
||||
.map_err(anyhow::Error::msg)?;
|
||||
// ContainerView.parent is read from topology.json — a
|
||||
// change here means every container row potentially
|
||||
// moves in the dashboard tree. Rescan + diff-emit so
|
||||
// open viewers repaint without polling.
|
||||
coord.rescan_containers_and_emit().await;
|
||||
HostResponse::success()
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue