carlos / platform Public

ops: RestoreVerify's doc says its scratch is on disk, not tmpfs

Spec 2026-12-03 sqlite-integrity-1 §5.4 (S2d). The comment said tmpDir
was the unit's PrivateTmp tmpfs; carlos-restore-verify.service sets
TMPDIR=%C/carlos-verify, so the copies are on disk. One copy at a time
still holds: restored bytes are charged to the unit's memory as page
cache. Comment only.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev efecf7b8d4cc7dca498caf0b459fdc9e2e5e654f parent 3ca0e30
1 file changed, +10 −8
  • internal/ops/litestream.go +10 −8

CI cancelled — superseded by a newer push — run details

CI log
=== gate ===
go: downloading go1.26.10 (linux/arm64)
go version go1.26.10 linux/arm64
opentofu: arm64, tofu 1.13.9, aws 6.73.0, archive 2.8.1
  tofu: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/tofu_1.13.9_linux_arm64.tar.gz
  tofu: downloaded, digest verified
  aws: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-aws_6.73.0_linux_arm64.zip
  aws: downloaded, digest verified
  archive: downloading https://carlos-ci-mirror-640012953448.s3.eu-west-1.amazonaws.com/opentofu/terraform-provider-archive_2.8.1_linux_arm64.zip
  archive: downloaded, digest verified
  installed in /tmp/carlos-opentofu-BlCs03
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2 v1.44.0
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
go: downloading golang.org/x/net v0.62.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/s3 v1.105.0
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading github.com/oschwald/maxminddb-golang v1.13.1
go: downloading github.com/pion/stun/v3 v3.1.5
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/aws/aws-sdk-go-v2/service/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/client_model v0.5.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.10
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.22
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/libc v1.74.1
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1

amadan: job cancelled — a newer push superseded it
diff --git a/internal/ops/litestream.go b/internal/ops/litestream.go
index d0bbee01f..62268e66b 100644
--- a/internal/ops/litestream.go
+++ b/internal/ops/litestream.go
@@ -488,14 +488,16 @@ var restoreAndCheckFn = restoreAndCheck
// caller (a oneshot unit) can exit non-zero where the fleet sweeps see it.
//
// Exactly ONE restored copy exists at a time: each is deleted as soon as it
-// has been checked. This is a memory constraint, not housekeeping —
-// carlos-restore-verify.service runs PrivateTmp=yes, so tmpDir is a tmpfs and
-// every byte written there is charged to the unit's own cgroup against
-// MemoryMax. Keeping all of them meant the drill's peak was the SUM of the
-// fleet's databases: measured on carlos-tito-ie 2026-08-15, 54 databases
-// totalling 247M under MemoryMax=256M, OOM-killed at a "256.2M memory peak"
-// after ~40 clean restores — a drill that grew its own failure as the fleet
-// grew. The peak is now the largest single database.
+// has been checked. This is a memory constraint, not housekeeping. tmpDir is
+// made under $TMPDIR, which carlos-restore-verify.service points at
+// %C/carlos-verify on disk rather than its PrivateTmp tmpfs, but the
+// restored bytes are still charged to the unit's own cgroup against
+// MemoryMax, as page cache. Keeping all of them made the drill's peak the
+// SUM of the fleet's databases: measured on carlos-tito-ie 2026-08-15, when
+// the copies were on tmpfs, 54 databases totalling 247M under
+// MemoryMax=256M were OOM-killed at a "256.2M memory peak" after ~40 clean
+// restores — a drill that grew its own failure as the fleet grew. The peak
+// is now the largest single database.
func RestoreVerify(litestreamBin, cfgPath, tmpDir string) error {
raw, err := os.ReadFile(cfgPath)
if err != nil {