Keep already mirrored SYSTEM unknowns bound to their original pin so a code-pair change cannot strand sync
Rust development slice / linux (push) Failing after 7s
Rust development slice / linux (push) Failing after 7s
This commit is contained in:
@@ -411,6 +411,17 @@ impl Store {
|
|||||||
self.check()?;
|
self.check()?;
|
||||||
Ok(changed == 1)
|
Ok(changed == 1)
|
||||||
}
|
}
|
||||||
|
/// Outcome hash of an already immutable mirror, if any.
|
||||||
|
pub fn mirrored_outcome(&self, id: Uuid) -> Result<Option<String>> {
|
||||||
|
Ok(self
|
||||||
|
.db
|
||||||
|
.query_row(
|
||||||
|
"SELECT outcome_sha256 FROM system_intent_mirrors WHERE id=?1",
|
||||||
|
[id.to_string()],
|
||||||
|
|r| r.get(0),
|
||||||
|
)
|
||||||
|
.optional()?)
|
||||||
|
}
|
||||||
pub fn mirrored(
|
pub fn mirrored(
|
||||||
&mut self,
|
&mut self,
|
||||||
id: Uuid,
|
id: Uuid,
|
||||||
|
|||||||
@@ -220,10 +220,15 @@ impl Client {
|
|||||||
)?;
|
)?;
|
||||||
let job = self.pin.binding.job(&intent.request.job_bytes)?;
|
let job = self.pin.binding.job(&intent.request.job_bytes)?;
|
||||||
let permit = intent.permit()?;
|
let permit = intent.permit()?;
|
||||||
|
// An unknown already mirrored with exactly this outcome stays bound
|
||||||
|
// to its original pin; a later code-pair change must not strand it.
|
||||||
|
let mirrored = store.mirrored_outcome(intent.id)?.as_deref()
|
||||||
|
== Some(row.outcome_sha256.as_str());
|
||||||
ensure!(
|
ensure!(
|
||||||
self.supports_system(&job)
|
self.supports_system(&job)
|
||||||
&& intent.policy_sha256 == self.pin.policy_sha256
|
&& ((intent.policy_sha256 == self.pin.policy_sha256
|
||||||
&& intent.helper_binary_sha256 == self.pin.helper.binary_sha256
|
&& intent.helper_binary_sha256 == self.pin.helper.binary_sha256)
|
||||||
|
|| mirrored)
|
||||||
&& snapshot.boot_id == intent.original_boot_id
|
&& snapshot.boot_id == intent.original_boot_id
|
||||||
&& snapshot.journal_id == intent.anchor.journal_id()
|
&& snapshot.journal_id == intent.anchor.journal_id()
|
||||||
&& snapshot.checkpoint >= intent.anchor.checkpoint(),
|
&& snapshot.checkpoint >= intent.anchor.checkpoint(),
|
||||||
|
|||||||
Reference in New Issue
Block a user