fix(#1989): don't relock on meta-update cascade rebuilds (was reverting the bump)
This commit is contained in:
parent
527dff0200
commit
1f0cc010ad
4 changed files with 36 additions and 6 deletions
|
|
@ -67,11 +67,17 @@ pub fn agent_config_pending(name: &str, deployed_sha: Option<&str>) -> bool {
|
|||
/// the `rebuild_queue` worker (lets the function annotate its phase via
|
||||
/// `coord.set_queue_step`) and `None` when called directly (e.g. the
|
||||
/// root-agent migration nudge in `ensure_root_agent`).
|
||||
///
|
||||
/// `relock` bumps the agent's meta input to `applied/<n>/main` before
|
||||
/// the container rebuild. Pass `false` only for meta-update cascade
|
||||
/// rebuilds, where re-locking would revert the bump the cascade just
|
||||
/// committed (see `lifecycle::rebuild`).
|
||||
pub async fn rebuild_agent(
|
||||
coord: &Arc<Coordinator>,
|
||||
name: &str,
|
||||
current_rev: &str,
|
||||
queue_entry_id: Option<u64>,
|
||||
relock: bool,
|
||||
) -> Result<()> {
|
||||
tracing::info!(%name, rev = %current_rev, "rebuild agent");
|
||||
let agent_dir = coord
|
||||
|
|
@ -88,6 +94,7 @@ pub async fn rebuild_agent(
|
|||
name,
|
||||
&hive,
|
||||
&paths,
|
||||
relock,
|
||||
&|step| coord.set_queue_step(queue_entry_id, step),
|
||||
&|log_id| {
|
||||
if let Some(qid) = queue_entry_id
|
||||
|
|
@ -176,7 +183,9 @@ pub async fn ensure_root_agent(coord: &Arc<Coordinator>) -> Result<()> {
|
|||
"manager container exists but no applied flake — forcing rebuild to migrate"
|
||||
);
|
||||
let coord_clone = coord.clone();
|
||||
if let Err(e) = rebuild_agent(&coord_clone, MANAGER_NAME, rev.as_str(), None).await {
|
||||
if let Err(e) =
|
||||
rebuild_agent(&coord_clone, MANAGER_NAME, rev.as_str(), None, true).await
|
||||
{
|
||||
tracing::warn!(error = ?e, "manager migration rebuild failed");
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue