c0re: keep power intent in memory, drop agent_power/kv tables and the stop snapshot
This commit is contained in:
parent
fca7f669f5
commit
b77fa9edc3
1 changed files with 222 additions and 553 deletions
|
|
@ -355,11 +355,11 @@ async fn handle_deploy_request(
|
|||
///
|
||||
/// Shared with [`crate::workers::wanted`] for the **seeding**, not the insert.
|
||||
/// `first_deploy`'s tail `Reconcile` seeds `Wanted` from the container's
|
||||
/// currently observed running state when no row exists yet
|
||||
/// (`power::Store::get_or_seed`), and at that point the container is freshly
|
||||
/// created but not started — so an unseeded row locks the agent to `Offline`
|
||||
/// currently observed running state when no intent is set yet
|
||||
/// (`PowerStore::get_or_seed`), and at that point the container is freshly
|
||||
/// created but not started — so an unseeded agent is locked to `Offline`
|
||||
/// on its very first reconcile and `Reconcile` never emits the `Start` node.
|
||||
/// Setting the row up front closes that window. A second caller open-coding
|
||||
/// Setting the intent up front closes that window. A second caller open-coding
|
||||
/// the insert would lose exactly that, and the agent would come up stopped for
|
||||
/// no visible reason.
|
||||
///
|
||||
|
|
@ -369,9 +369,7 @@ pub(crate) fn queue_first_deploy(
|
|||
coord: &std::sync::Arc<crate::coordinator::Coordinator>,
|
||||
agent: &str,
|
||||
) -> Result<Option<Vec<hive_jobq::NodeId>>> {
|
||||
if let Err(e) = coord.power.set(agent, crate::power::Wanted::Up) {
|
||||
tracing::warn!(%agent, error = ?e, "agent_power: seed on swarm first-deploy failed");
|
||||
}
|
||||
coord.power.set(agent, crate::power::Wanted::Up);
|
||||
coord.job_queue.insert_first_deploy_once(agent)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue