From dc4bf91b1597078c87fdb4b785cbf4b1f7301dbd Mon Sep 17 00:00:00 2001 From: Brian Neville <29639579+brianneville@users.noreply.github.com> Date: Thu, 4 Sep 2025 11:40:50 +0100 Subject: [PATCH 1/3] gnoi/os: make package_size required. If the package_size field is unspecified, then the target will proceed without knowing how large the incoming image is. This can lead to the target returning an error mid-RPC if it runs out of disk space to store the incoming image. To handle this the target is left with two options. Either it must: 1. assume some default size of the image 2. not free-up any space for the incoming image If the target does 1 then the assumed image size may be less than the actual image (which would cause the target to not free up enough space) OR the assumed image size may be larger than the actual image (which may cause the target to free up excess space, possibly deleting images needlessly). If the target does 2 then the RPC will fail if there is not enough space, irrespective of if there were unused images, and someone would need to manually clean up the unused images from the target before running the RPC again. In both cases, we could still fail the RPC if we don't have enough space. We should therefore make this package_size field required, so that: - the target can fail gracefully if the incoming package is too large rather than mid-way through the RPC. - the target can free-up space without needing the network operator to ever manually clean up images. --- os/os.proto | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/os/os.proto b/os/os.proto index b92fcc59..d7153eb9 100644 --- a/os/os.proto +++ b/os/os.proto @@ -193,11 +193,10 @@ message TransferRequest { // if requested to install on standby only. bool standby_supervisor = 2; - // Optionally specify the package size in bytes of the OS package being + // Specify the package size in bytes of the OS package being // transferred. - // If 1) the value is different than 0 - // and 2) the required space in the Target is larger than the available space - // and 3) the Target is unable to release space for the incoming OS package, + // If 1) the required space in the Target is larger than the available space + // and 2) the Target is unable to release space for the incoming OS package, // then the Target must reply with InstallError->Type->TOO_LARGE. uint64 package_size = 3; } From ff45888fecbe22084fa0dffc2ceb9ec044270c15 Mon Sep 17 00:00:00 2001 From: Brian Neville <29639579+brianneville@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:55:58 +0100 Subject: [PATCH 2/3] gnoi/os: update comment to note that the package_size is not required, but is recommended. --- os/os.proto | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/os/os.proto b/os/os.proto index d7153eb9..917fa0a9 100644 --- a/os/os.proto +++ b/os/os.proto @@ -193,11 +193,14 @@ message TransferRequest { // if requested to install on standby only. bool standby_supervisor = 2; - // Specify the package size in bytes of the OS package being + // Optionally specify the package size in bytes of the OS package being // transferred. - // If 1) the required space in the Target is larger than the available space - // and 2) the Target is unable to release space for the incoming OS package, + // If 1) the value is different than 0 + // and 2) the required space in the Target is larger than the available space + // and 3) the Target is unable to release space for the incoming OS package, // then the Target must reply with InstallError->Type->TOO_LARGE. + // It is recommended that this field be set, as the Target may + // rely on it to free up disk space. uint64 package_size = 3; } From dd9be7b903791596896bea52b7adb3a04f984d75 Mon Sep 17 00:00:00 2001 From: Brian Neville <29639579+brianneville@users.noreply.github.com> Date: Thu, 11 Sep 2025 14:57:48 +0100 Subject: [PATCH 3/3] reword comment --- os/os.proto | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/os/os.proto b/os/os.proto index 917fa0a9..4c304d6b 100644 --- a/os/os.proto +++ b/os/os.proto @@ -199,8 +199,8 @@ message TransferRequest { // and 2) the required space in the Target is larger than the available space // and 3) the Target is unable to release space for the incoming OS package, // then the Target must reply with InstallError->Type->TOO_LARGE. - // It is recommended that this field be set, as the Target may - // rely on it to free up disk space. + // It is recommended that this field be set, so that the Target can + // free up space more precisely. uint64 package_size = 3; }