R-1199 reopened: a box with no list of its own reads the household's from the hub and adopts it, pushes its default once only when no household saved one; every push names its source; an empty saved list stays empty; R-1216 (D28 = A): the install page's swap sentence only when host swap is really short (shared case table); unreleased
gates / gates (push) Successful in 1m55s
gates / gates (push) Successful in 1m55s
This commit is contained in:
@@ -193,8 +193,9 @@ func procMemTotalMB() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// hostSwapShort (R-1192 follow-up, night 2026-10-21) asks the agent whether the HOST's swap is below this guest's RAM
|
||||
// — the guest swap fix (swap = RAM) puts a memory burst there, and a host with none gets nothing from it. False when
|
||||
// hostSwapShort (R-1192 follow-up, night 2026-10-21; the rule R-1216 / D28 = A, 2026-10-22) asks the agent whether the
|
||||
// HOST has too little swap behind this guest — the guest swap fix (swap = RAM) puts a memory burst there, and a host
|
||||
// with none gets nothing from it. False when
|
||||
// it cannot tell (an older agent, an agent that does not answer within 2 s): the install page then shows only the
|
||||
// overcommit sentence, as before.
|
||||
func (s *Server) hostSwapShort() bool {
|
||||
@@ -211,7 +212,38 @@ func (s *Server) hostSwapShort() bool {
|
||||
return swapShort(info)
|
||||
}
|
||||
|
||||
// swapShort: the host's swap is known and below the guest's RAM.
|
||||
// swapShort: the host's swap is known and short for this guest's swap allowance (the agent's guest_swap_mb; the guest's
|
||||
// RAM when an agent reports none — the fix sets swap = RAM) under the shared rule below.
|
||||
func swapShort(info agentapi.GuestMemoryInfo) bool {
|
||||
return info.HostSwapMB != nil && info.AllocatedMB > 0 && *info.HostSwapMB < info.AllocatedMB
|
||||
if info.HostSwapMB == nil {
|
||||
return false // an older agent: not judged
|
||||
}
|
||||
guest := info.AllocatedMB
|
||||
if info.GuestSwapMB != nil {
|
||||
guest = *info.GuestSwapMB
|
||||
}
|
||||
return hostSwapRuleShort(*info.HostSwapMB, guest)
|
||||
}
|
||||
|
||||
// installerMaxSwapMB is the most host swap Proxmox's installer gives any machine (Install.pm compute_swapsize: the RAM,
|
||||
// at least 4096 MB on a disk of 64 GB or more, at most 8192 MB; read from the 9.2-1 ISO, 2026-10-22).
|
||||
const installerMaxSwapMB = 8192
|
||||
|
||||
// hostSwapRuleShort is the R-1216 rule (D28 = A, operator 2026-10-22), the SAME as the hub's host_swap_short: short when
|
||||
// the host has no swap, or less than 90 % of min(the guests' swap allowance, 8192 MB). The morning's first rule (host
|
||||
// swap < the guest's RAM) told every household with a guest above 8 GB to call us; the 8 GB soak's burst used 2.7 GB.
|
||||
// The CONTRACT is testdata/host_swap_rule_cases.json, byte-identical in felhom.eu's hub (felhom.eu
|
||||
// scripts/host_swap_rule_gate.py); TestR1216_HostSwapRuleCases runs it here.
|
||||
func hostSwapRuleShort(hostMB, guestMB int64) bool {
|
||||
if hostMB <= 0 {
|
||||
return true
|
||||
}
|
||||
need := guestMB
|
||||
if need > installerMaxSwapMB {
|
||||
need = installerMaxSwapMB
|
||||
}
|
||||
if need <= 0 {
|
||||
return false
|
||||
}
|
||||
return hostMB*10 < need*9
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user