v0.317.0: a second copy counts only on a proven different disk; the no-drive install speaks in words (felhom.eu architecture/16, build A)
gates / gates (push) Successful in 46s
gates / gates (push) Successful in 46s
Tier-2 and the one-copy notice ask the host agent (POST /disks/same-disk, agent 0.157.0): different + proven -> made and counted; same disk -> not made (D1); unknown (VM, hidden USB serial) -> made, not counted, the row says why (D2); a NAS never counts and no longer hides the notice (R-1075). An older agent keeps the st_dev rule, logged once. D4: a data-folder or media app on a box with no drive is refused in words with a link to the drives page (R-1068's raw-error half). MinAgent 0.157.0. Claude-Session: https://claude.ai/code/session_012qRErfCoiTkvDK9N5XHbzb
This commit is contained in:
@@ -583,6 +583,29 @@ func main() {
|
||||
// re-rendered or the restored shares exist on paper but are not exported. A seam rather than a
|
||||
// direct call — the backup package must not depend on the stacks package.
|
||||
backupMgr.SetSharesReconciler(stackMgr.ReconcileSamba)
|
||||
// v0.317.0 (felhom.eu architecture/16-storage-physical-identity.md §4): every Tier-2 and one-copy
|
||||
// decision asks the HOST AGENT whether two paths share a physical disk. An agent older than 0.157.0
|
||||
// (FeatureSameDisk) or a failed call → supported=false → the backup side keeps the old st_dev rule,
|
||||
// logged once. Pinned by TestDiskJudge_IsWiredAtStartup.
|
||||
if cfg.LocalAPI.Endpoint != "" && cfg.LocalAPI.Token != "" {
|
||||
if ac, err := agentapi.New(cfg.LocalAPI.Endpoint, cfg.LocalAPI.Token, cfg.LocalAPI.Fingerprint); err != nil {
|
||||
logger.Printf("[WARN] [backup] same-disk: agent client init failed (%v) — the st_dev rule stays", err)
|
||||
} else {
|
||||
backupMgr.SetDiskJudge(func(a, b string) (backup.DiskVerdict, bool) {
|
||||
jctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
|
||||
defer cancel()
|
||||
if ac.Supports(jctx, agentapi.FeatureSameDisk) == agentapi.SupportNo {
|
||||
return backup.DiskVerdict{}, false
|
||||
}
|
||||
r, err := ac.SameDisk(jctx, a, b)
|
||||
if err != nil {
|
||||
logger.Printf("[WARN] [backup] same-disk: agent call failed for %s / %s: %v", a, b, err)
|
||||
return backup.DiskVerdict{}, false
|
||||
}
|
||||
return backup.DiskVerdict{Different: r.Different, Proven: r.Proven, Reason: r.Reason}, true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// --- Slice 4: the guarded update's backup side ---
|
||||
|
||||
Reference in New Issue
Block a user