carlos / platform Public

deps: litestream 0.5.18, ltx 0.5.2, lz4 v4.1.34 (#1443 follow-up)

litestream 0.5.18 detaches its WAL read lock from the caller's context
(acquireReadLock, WithoutCancel), which closes the case the narrow fix
leaves open: a litestream checkpoint inside one of our short-context
SyncAndWait calls on an awake instance. ltx 0.5.2 returns the input
header error its Compactor used to drop ("decode header: EOF"). lz4 is
pinned to v4.1.34: v4.1.23, which go get picks, is retracted for
dropping data.

Adjustments for 0.5.18's behaviour:
- its snapshot reader is no longer a bare *io.PipeReader; the four
  pipe-closing sites (#811, #1193) now close any pipe-backed body
  (closePipeBody), so a refused snapshot still releases the WAL;
- restores open up to 32 planned files at once; the CLI's door recorder
  serialises its downloads so a person's restore still holds one door
  stream (dbMaxStreamsPerPrincipal is 4);
- litestream re-plans a vanished file itself: the whole-restore retry
  test accepts one or two listings, the vanishing fixture tolerates a
  second open, and the cancelled-snapshot witness accepts an encoder
  that ended before it blocked (the WAL release is still checked).

Census: envelopes ., internal/dbdoor and internal/lease re-pinned.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
claude agent, operated by paul@keymail.dev pushed by paul@keymail.dev 4e973467b797c21167087d0cf9f9a68074943f49 parent cc6c77b
14 files changed, +120 −36
  • docs/superpowers/notes/census-proposal-litestream-0518-1443.md +11 −0
  • go.mod +6 −6
  • go.sum +33 −0
  • internal/dbdoor/restore.go +8 −2
  • internal/dbdoor/restore_test.go +5 −2
  • internal/lease/check_test.go +3 −1
  • internal/lease/claimgeneration.go +1 −3
  • internal/lease/claimgeneration_snapshot_linux_test.go +1 −3
  • internal/lease/fencegate.go +1 −3
  • internal/lease/resolve.go +1 −3
  • internal/lease/snapshotpipe.go +19 −3
  • internal/lease/teardown_linux_test.go +25 −10
  • internal/provision/testdata/plan14-root-reads-chain.tsv +1 −0
  • internal/provision/testdata/plan14-root-reads-litestream-0518-1443.tsv +5 −0

CI failed — 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-T7mD22
.amadan/test-gate.sh
go: downloading github.com/aws/aws-sdk-go-v2/service/costexplorer v1.67.5
go: downloading github.com/benbjohnson/litestream v0.5.18
go: downloading github.com/superfly/ltx v0.5.2
go: downloading github.com/aws/aws-sdk-go-v2/service/cloudwatch v1.68.0
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/acm v1.45.0
go: downloading github.com/aws/aws-sdk-go-v2/service/ec2 v1.324.0
go: downloading github.com/aws/aws-sdk-go-v2/service/iam v1.58.2
go: downloading github.com/aws/aws-sdk-go-v2/service/resourcegroupstaggingapi v1.37.0
go: downloading github.com/aws/aws-sdk-go-v2/service/route53 v1.64.1
go: downloading golang.org/x/sys v0.49.0
go: downloading golang.org/x/crypto v0.58.0
go: downloading github.com/oschwald/maxminddb-golang v1.13.1
go: downloading github.com/pion/turn/v4 v4.1.4
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/pion/transport/v4 v4.0.2
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/pion/dtls/v3 v3.1.4
go: downloading github.com/wlynxg/anet v0.0.5
go: downloading github.com/pierrec/lz4/v4 v4.1.34
go: downloading golang.org/x/text v0.43.0
go: downloading github.com/prometheus/client_golang v1.17.0
go: downloading github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.20.18
go: downloading golang.org/x/sync v0.24.0
go: downloading github.com/lmittmann/tint v1.1.3
go: downloading github.com/beorn7/perks v1.0.1
go: downloading github.com/cespare/xxhash/v2 v2.3.0
go: downloading github.com/prometheus/procfs v0.12.0
go: downloading google.golang.org/protobuf v1.36.11
go: downloading github.com/prometheus/common v0.45.0
go: downloading github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.34
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 github.com/google/uuid v1.6.0
go: downloading modernc.org/mathutil v1.7.1
go: downloading modernc.org/memory v1.11.0
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/google/uuid v1.6.0
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== launchctx (4 s, from +0 s)
ok  	amadan.net/carlos/platform.git/launchctx	0.015s
?   	amadan.net/carlos/platform.git/launchctx/controlname	[no test files]
?   	amadan.net/carlos/platform.git/launchctx/wireid	[no test files]
=== vet (178 s, from +0 s)
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.34
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/mathutil v1.7.1
go: downloading github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec
=== vet-tags (177 s, from +0 s)
go: downloading modernc.org/sqlite v1.55.0
go: downloading github.com/klauspost/compress v1.20.2
go: downloading github.com/aws/aws-sdk-go-v2/service/ecs v1.91.0
go: downloading github.com/pierrec/lz4/v4 v4.1.34
go: downloading modernc.org/libc v1.74.1
go: downloading modernc.org/memory v1.11.0
go: downloading github.com/dustin/go-humanize v1.0.1
go: downloading modernc.org/mathutil v1.7.1
=== gofmt (1 s, from +0 s)
gofmt -l .: clean
=== rest (387 s, from +15 s)
ok  	github.com/carlosframework/platform/cmd/carlos-media	132.092s
?   	github.com/carlosframework/platform/cmd/changelog	[no test files]
ok  	github.com/carlosframework/platform/cmd/console	201.813s
ok  	github.com/carlosframework/platform/cmd/mediaimage	40.545s
ok  	github.com/carlosframework/platform/cmd/moveprobe	16.869s
ok  	github.com/carlosframework/platform/cmd/pricebook-export	0.101s
ok  	github.com/carlosframework/platform/cmd/rootfswitness	0.179s
ok  	github.com/carlosframework/platform/cmd/runsc-assets	0.186s
ok  	github.com/carlosframework/platform/cmd/zddprobe	1.089s
ok  	github.com/carlosframework/platform/internal/agentsock	0.146s
ok  	github.com/carlosframework/platform/internal/alerting	0.051s
ok  	github.com/carlosframework/platform/internal/analytics	0.467s
ok  	github.com/carlosframework/platform/internal/appconfig	40.878s
ok  	github.com/carlosframework/platform/internal/apperr	0.625s
ok  	github.com/carlosframework/platform/internal/applog	0.776s
ok  	github.com/carlosframework/platform/internal/apppolicy	3.728s
ok  	github.com/carlosframework/platform/internal/assetcache	0.697s
ok  	github.com/carlosframework/platform/internal/awsinv	0.036s
ok  	github.com/carlosframework/platform/internal/awsmanaged	9.203s
ok  	github.com/carlosframework/platform/internal/awsregiongroup	0.415s
ok  	github.com/carlosframework/platform/internal/awsterminations	0.048s
ok  	github.com/carlosframework/platform/internal/backupswords	0.018s
ok  	github.com/carlosframework/platform/internal/billing	0.124s
ok  	github.com/carlosframework/platform/internal/billing/billingtest	0.100s
ok  	github.com/carlosframework/platform/internal/billingstripe	2.571s
ok  	github.com/carlosframework/platform/internal/boxchoice	0.012s
ok  	github.com/carlosframework/platform/internal/boxid	3.519s
?   	github.com/carlosframework/platform/internal/boxid/boxidtest	[no test files]
?   	github.com/carlosframework/platform/internal/boxid/internal/signtest	[no test files]
ok  	github.com/carlosframework/platform/internal/boxroles	0.015s
ok  	github.com/carlosframework/platform/internal/boxself	0.410s
ok  	github.com/carlosframework/platform/internal/boxvolumes	0.087s
ok  	github.com/carlosframework/platform/internal/caps	5.310s
ok  	github.com/carlosframework/platform/internal/certwarm	0.009s
ok  	github.com/carlosframework/platform/internal/cgroup	1.498s
ok  	github.com/carlosframework/platform/internal/changelog	5.270s
ok  	github.com/carlosframework/platform/internal/clamd	0.093s
?   	github.com/carlosframework/platform/internal/cliflag	[no test files]
ok  	github.com/carlosframework/platform/internal/clireg	0.007s
ok  	github.com/carlosframework/platform/internal/codehealth	17.239s
ok  	github.com/carlosframework/platform/internal/compute	0.022s
ok  	github.com/carlosframework/platform/internal/consolefleet	0.009s
?   	github.com/carlosframework/platform/internal/controlname	[no test files]
?   	github.com/carlosframework/platform/internal/controlsock	[no test files]
ok  	github.com/carlosframework/platform/internal/dbdoor	16.040s
ok  	github.com/carlosframework/platform/internal/dbdoor/dbdoortest	0.026s
ok  	github.com/carlosframework/platform/internal/dbquery	0.044s
ok  	github.com/carlosframework/platform/internal/dbreads	3.633s
?   	github.com/carlosframework/platform/internal/dbreads/dbreadstest	[no test files]
ok  	github.com/carlosframework/platform/internal/dbverify	0.077s
ok  	github.com/carlosframework/platform/internal/demo	0.042s
ok  	github.com/carlosframework/platform/internal/demobuild	4.624s
ok  	github.com/carlosframework/platform/internal/democlaim	0.766s
ok  	github.com/carlosframework/platform/internal/devbox	15.664s
ok  	github.com/carlosframework/platform/internal/dnsrec	0.007s
ok  	github.com/carlosframework/platform/internal/docsite	0.195s
ok  	github.com/carlosframework/platform/internal/domainreg	0.053s
ok  	github.com/carlosframework/platform/internal/domains	69.200s
ok  	github.com/carlosframework/platform/internal/doorkey	0.021s
ok  	github.com/carlosframework/platform/internal/economics	0.015s
ok  	github.com/carlosframework/platform/internal/edgefence	0.252s
ok  	github.com/carlosframework/platform/internal/edgeguard	0.537s
?   	github.com/carlosframework/platform/internal/edgeproof	[no test files]
ok  	github.com/carlosframework/platform/internal/edgesfile	0.132s
ok  	github.com/carlosframework/platform/internal/egressaddr	0.032s
ok  	github.com/carlosframework/platform/internal/execsandbox	97.382s
ok  	github.com/carlosframework/platform/internal/fileacl	0.011s
ok  	github.com/carlosframework/platform/internal/fleetapi	2.775s
ok  	github.com/carlosframework/platform/internal/fleetstore	0.018s
ok  	github.com/carlosframework/platform/internal/fxrate	0.050s
ok  	github.com/carlosframework/platform/internal/gate	7.247s
ok  	github.com/carlosframework/platform/internal/genselect	0.148s
ok  	github.com/carlosframework/platform/internal/geo	0.080s
ok  	github.com/carlosframework/platform/internal/geoip	0.176s
ok  	github.com/carlosframework/platform/internal/groupadmission	0.012s
ok  	github.com/carlosframework/platform/internal/grouprollaws	17.371s
ok  	github.com/carlosframework/platform/internal/hadeparture	0.040s
ok  	github.com/carlosframework/platform/internal/hafresh	0.013s
ok  	github.com/carlosframework/platform/internal/hairpin	0.250s
ok  	github.com/carlosframework/platform/internal/historyreadback	1.257s
ok  	github.com/carlosframework/platform/internal/hostactors	22.058s
ok  	github.com/carlosframework/platform/internal/hostbox	22.216s
ok  	github.com/carlosframework/platform/internal/hostclaim	3.740s
ok  	github.com/carlosframework/platform/internal/hostenv	0.089s
ok  	github.com/carlosframework/platform/internal/hostevidence	0.022s
ok  	github.com/carlosframework/platform/internal/hostexec	23.687s
ok  	github.com/carlosframework/platform/internal/hostfence	0.202s
ok  	github.com/carlosframework/platform/internal/hostfiles	25.480s
ok  	github.com/carlosframework/platform/internal/hostfloor	0.077s
ok  	github.com/carlosframework/platform/internal/hostguard	1.683s
ok  	github.com/carlosframework/platform/internal/hostops	7.890s
?   	github.com/carlosframework/platform/internal/hostops/fencerelease	[no test files]
ok  	github.com/carlosframework/platform/internal/hostops/internal/fencerelease	0.016s
ok  	github.com/carlosframework/platform/internal/hostquarantine	0.024s
ok  	github.com/carlosframework/platform/internal/hostrelocate	2.993s
ok  	github.com/carlosframework/platform/internal/hostresolve	0.598s
ok  	github.com/carlosframework/platform/internal/hostwrite	0.047s
ok  	github.com/carlosframework/platform/internal/infraview	0.009s
ok  	github.com/carlosframework/platform/internal/ingresshealth	0.017s
ok  	github.com/carlosframework/platform/internal/ingresshealth/awstg	0.018s
ok  	github.com/carlosframework/platform/internal/instancectl	61.661s
ok  	github.com/carlosframework/platform/internal/instanceexec	9.306s
ok  	github.com/carlosframework/platform/internal/instancefs	0.054s
ok  	github.com/carlosframework/platform/internal/instancekey	0.018s
ok  	github.com/carlosframework/platform/internal/instanceupdates	0.047s
ok  	github.com/carlosframework/platform/internal/interactive	0.939s
ok  	github.com/carlosframework/platform/internal/launchd	0.033s
ok  	github.com/carlosframework/platform/internal/layout	24.704s
ok  	github.com/carlosframework/platform/internal/layout/pubclass	95.332s
ok  	github.com/carlosframework/platform/internal/lbhealth	0.029s
ok  	github.com/carlosframework/platform/internal/lease	148.446s
ok  	github.com/carlosframework/platform/internal/lease/leasetest	1.772s
ok  	github.com/carlosframework/platform/internal/lease/locktest	0.020s
ok  	github.com/carlosframework/platform/internal/ledger	0.050s
ok  	github.com/carlosframework/platform/internal/mail	1.541s
ok  	github.com/carlosframework/platform/internal/mailer	1.040s
ok  	github.com/carlosframework/platform/internal/mailsubmit	1.608s
ok  	github.com/carlosframework/platform/internal/mailwire	0.007s
ok  	github.com/carlosframework/platform/internal/maintenance	0.175s
ok  	github.com/carlosframework/platform/internal/maintenanceexec	8.173s
ok  	github.com/carlosframework/platform/internal/maintenanceguard	0.350s
ok  	github.com/carlosframework/platform/internal/managedboot	3.617s
?   	github.com/carlosframework/platform/internal/managedboot/boottest	[no test files]
?   	github.com/carlosframework/platform/internal/managedboot/roottest	[no test files]
ok  	github.com/carlosframework/platform/internal/media	1.955s
ok  	github.com/carlosframework/platform/internal/media/mediatest	0.009s
ok  	github.com/carlosframework/platform/internal/mediaaws	61.604s
ok  	github.com/carlosframework/platform/internal/mediahandler	41.157s
ok  	github.com/carlosframework/platform/internal/mediajobs	0.970s
ok  	github.com/carlosframework/platform/internal/medialocal	10.185s
ok  	github.com/carlosframework/platform/internal/metrics	0.149s
ok  	github.com/carlosframework/platform/internal/minorunits	0.014s
ok  	github.com/carlosframework/platform/internal/moves	27.662s
ok  	github.com/carlosframework/platform/internal/moves/archive	3.237s
ok  	github.com/carlosframework/platform/internal/moves/offlinerun	0.093s
ok  	github.com/carlosframework/platform/internal/namedunits	0.030s
ok  	github.com/carlosframework/platform/internal/objstore	2.347s
ok         plain.example.com (txid 3, freshness unknown)
ok         pooled.example.com (txid 3, freshness unknown)
ok         resident.example.com (txid 3, freshness unknown)
ok         worker.shop.k3x9.sidecar.internal (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (4 hosts, 0 unverified)
hibernate-verify: 4 of 4 replicas this box drills proven this run (4 visited, 4 in its record)
ok         plain.example.com (txid 3, freshness unknown)
ok         worker.shop.k3x9.sidecar.internal (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
unverified elsewhere.example.com: no_record its record places it in "ie", not this box's "uk"
ok         static.example.com (txid 3, freshness unknown)
ok         addr.example.com (txid 3, freshness unknown)
unverified nothing.example.com: no_record this box has the host, but there is no instance record for it
unverified worker.shop.k3x9.sidecar.internal: no_record its record places it in "ie", not this box's "uk"
unverified gone.shop.k3x9.sidecar.internal: no_record this box has the sidecar, but there is no sidecar record for it
unverified named.shop.k3x9.sidecar.internal: no_record the sidecar record "named" names host "someone-else.sidecar.internal", not this one
unverified worker.shop.k3x9.sidecar.internal: record_changed the instance changed during the test, so its result was discarded
unverified worker.shop.k3x9.sidecar.internal: record_changed the instance changed during the test, so its result was discarded
unverified worker.shop.k3x9.sidecar.internal: record_changed the instance changed during the test, so its result was discarded
ok         local.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (1 hosts, 0 unverified)
hibernate-verify: 1 of 1 replicas this box drills proven this run (1 visited, 1 in its record)
ok         local.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 1 unverified)
hibernate-verify: 1 of 1 replicas this box drills proven this run (1 visited, 2 in its record)
unverified away.example.com: no_record its record places it in "uk", not this box's ""
ok         home.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 1 unverified)
hibernate-verify: 1 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
unverified home.example.com: no_record its record places it in "", not this box's "uk"
unverified home.example.com: record_changed the instance changed during the test, so its result was discarded
FAIL       a.example.com: restore_error restore: decode database: decode page 3: file checksum mismatch
FAIL       a.example.com: restore_error restore: decode database: decode header: unmarshal header: invalid LTX file
unverified a.example.com: storage_unavailable restore: decode database: decode page 3: unexpected EOF
unverified a.example.com: storage_unavailable open: disk I/O error (10)
unverified a.example.com: storage_unavailable restore: decode database: unexpected pgno while decoding page: read 7, expected 6
unverified a.example.com: storage_unavailable restore: cannot calc restore plan: operation error S3: GetObject, api error SlowDown: reduce your request rate
unverified a.example.com: storage_unavailable restore: decode database: write page 9: write /var/cache/carlos-verify/x/verify.db.tmp: no space left on device
FAIL       a.example.com: restore_error lease: the restored copy failed its check: integrity_check: page 4 corrupt
FAIL       a.example.com: restore_error restore: ltx file corrupted
unverified a.example.com: storage_unavailable restore: decode database: file checksum mismatch (the replica's last read error: read tcp: connection reset by peer)
unverified a.example.com: storage_unavailable restore: decode database: decode header: EOF (the replica's last read error: read tcp: connection reset by peer)
unverified a.example.com: storage_unavailable plan: list: operation error S3: GetObject, api error SlowDown: reduce your request rate
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
unverified a.example.com: plan_moved plan: dbdoor: read the last planned file's header: file does not exist
unverified a.example.com: plan_moved restore: restore plan retries exhausted for txid 0000000000000003: decode database: decode header: decode header for input 0: reopen ltx file at offset 0: file does not exist
--- FAIL: TestVerifyHibernatingReplansAMissingObject (0.01s)
    --- FAIL: TestVerifyHibernatingReplansAMissingObject/contents_gone_once (0.01s)
        hibernate_verify_restore_test.go:161: planned 1 times over 1 resolutions, want once and one replan over one (G4)
FAIL       a.example.com: restore_error integrity_check: *** in database main ***
Tree 2 page 3 cell 98: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 97: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 96: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 95: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 94: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 93: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 92: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 91: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 90: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 89: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 88: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 87: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 86: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 85: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 84: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 83: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 82: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 81: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 80: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 79: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 78: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 77: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 76: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 75: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 74: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 73: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 72: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 71: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 70: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 69: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 68: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 67: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 66: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 65: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 64: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 63: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 62: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 61: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 60: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 59: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 58: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 57: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 56: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 55: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 54: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 53: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 52: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 51: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 50: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 49: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 48: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 47: Offset 42405 out of range 235..4092
Tree 2 page 3 cell 46: Offset 42405 out of range 235..4092
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (1 hosts, 1 unverified)
ok         a.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (3 hosts, 0 unverified)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: moved.example.com left this box's record while the run went on (a move landed); not publishing it again
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
ok         moved.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
hibernate-verify: 3 of 3 replicas this box drills proven this run (3 visited, 2 in its record)
abandoned  a.example.com: the run ended during its test; no verdict, and it goes to the back of the next run
hibernate-verify: the run's budget (300ms) is spent after 1 of 3 hosts; the rest keep their previous verdict
ok         a.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (1 hosts, 0 unverified)
hibernate-verify: 1 of 1 replicas this box drills proven this run (1 visited, 1 in its record)
ok         a.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (1 hosts, 0 unverified)
hibernate-verify: 1 of 1 replicas this box drills proven this run (1 visited, 1 in its record)
hibernate-verify: no hibernating instances for this box to drill
hibernate-verify: published control/verify/box-a.json (0 hosts, 0 unverified)
hibernate-verify: no hibernating instances for this box to drill; its record is cleared
unverified landed.example.com: moving the instance was moving when the test began
ok         control.example.com (txid 3, freshness unknown)
unverified a.example.com: moving the instance changed during the test, so its result was discarded
unverified a.example.com: moving the instance changed during the test, so its result was discarded
unverified a.example.com: moving the instance changed during the test, so its result was discarded
unverified a.example.com: moving the instance changed during the test, so its result was discarded
unverified a.example.com: moving the instance changed during the test, so its result was discarded
unverified a.example.com: moving the instance changed during the test, so its result was discarded
ok         a.example.com (txid 3, freshness unknown)
unverified a.example.com: moving the instance was moving when the test began
ok         a.example.co (txid 3, freshness unknown)
unverified a.example.com: storage_unavailable move staging: list moves/a.example.com/: AccessDenied: list moves/
unverified a.example.com: storage_unavailable the move staging could not be read again after the restore, so its result was discarded: move staging: list moves/a.example.com/: AccessDenied: list moves/
unverified a.example.com: storage_unavailable the move staging could not be read again after the restore, so its result was discarded: move staging: list moves/a.example.com/: AccessDenied: list moves/
unverified a.example.com: storage_unavailable move staging: load aws config: no region
unverified b.example.com: storage_unavailable move staging: load aws config: no region
unverified a.example.com: moving the instance changed during the test, so its result was discarded
unverified a.example.com: moving the instance changed during the test, so its result was discarded
ok         a.example.com (txid 3, freshness unknown)
unverified a.example.com: record_changed the instance changed during the test, so its result was discarded
unverified a.example.com: record_changed the instance changed during the test, so its result was discarded
unverified a.example.com: record_changed the instance changed during the test, so its result was discarded
ok         a.example.com (txid 3, freshness unknown)
unverified a.example.com: record_changed the instance changed during the test, so its result was discarded
ok         good.example.com (txid 3, freshness unknown)
FAIL       damaged.example.com: restore_error lease: the restored copy failed its check: integrity_check: page 4 corrupt
unverified new.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
left out   site.example.com: no database here (nothing replicated, and no file at /tmp/TestVerifyHibernatingLeavesOutAHostWithNoDatabase1289154876/001/absent.db)
left out   site.example.com: no database here (nothing replicated, and no file at /tmp/TestVerifyHibernatingLeavesOutAHostWithNoDatabase1289154876/001/absent.db)
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: moving the instance was moving when the test began
left out   site.example.com: no database here (nothing replicated, and no file at /tmp/TestVerifyHibernatingLeavesOutAHostWithNoDatabase1289154876/001/absent.db)
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
left out   site.example.com: no database here (nothing replicated, and no file at /tmp/TestVerifyHibernatingLeavesOutAHostWithNoDatabase1289154876/001/absent.db)
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: storage_unavailable move staging: list moves/site.example.com/: AccessDenied
unverified site.example.com: record_changed the instance changed during the test, so its result was discarded
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: no_record this box has the host, but there is no instance record for it
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
unverified site.example.com: nothing_replicated no replica yet
ok         x.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: 2 of 3 hosts this run (--max 2); the rest keep their previous verdict
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
ok         c.example.com (txid 3, freshness unknown)
FAIL       frozen.example.com: stale replica is at change 2, the live database at 31, and the database has been quiet since 2026-11-26T09:22:29Z — replication has stopped
ok         shop.example.com (txid 3, freshness unknown)
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified shop.example.com: moving the instance changed during the test, so its result was discarded
unverified moving.example.com: moving the instance was moving when the test began
unverified elsewhere.example.com: no_record its record places it in "ie", not this box's "uk"
unverified retired.example.com: no_record this box has the host, but there is no instance record for it
unverified gone.example.com: no_record this box has the host, but there is no instance record for it
unverified shop.example.com: no_record this box has the host, but there is no instance record for it
unverified shop.example.com: no_record this box has the host, but there is no instance record for it
unverified shop.example.com: no_record this box has the host, but there is no instance record for it
unverified shop.example.com: no_record this box has the host, but there is no instance record for it
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
unverified shop.example.com: record_changed the instance changed during the test, so its result was discarded
ok         a.example.com (txid 3, freshness unknown)
unverified a.example.com: plan_moved restore: transaction not available
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
ok         a.example.com (txid 3, freshness unknown)
FAIL       a.example.com: stale replica is at change 2, the live database at 31, and the database has been quiet since 2026-11-26T09:22:29Z — replication has stopped
ok         a.example.com (txid 3, freshness not_stale)
ok         d.example.com (txid 3, freshness unknown)
ok         e.example.com (txid 3, freshness unknown)
ok         f.example.com (txid 3, freshness unknown)
hibernate-verify: the run's budget (25m0s) is spent after 3 of 6 hosts; the rest keep their previous verdict
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
ok         c.example.com (txid 3, freshness unknown)
hibernate-verify: the run's budget (25m0s) is spent after 3 of 6 hosts; the rest keep their previous verdict
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
abandoned  c.example.com: the run ended during its test; no verdict, and it goes to the back of the next run
hibernate-verify: the run's budget (300ms) is spent after 3 of 4 hosts; the rest keep their previous verdict
hibernate-verify: published control/verify/box-a.json (4 hosts, 2 unverified)
ok         a.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 1 unverified)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
ok         a.example.com (txid 3, freshness unknown)
unverified moving.example.com: moving the instance was moving when the test began
hibernate-verify: published control/verify/box-a.json (5 hosts, 5 unverified)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (5 hosts, 4 unverified)
ok         c.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (5 hosts, 3 unverified)
ok         d.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (5 hosts, 2 unverified)
ok         e.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (5 hosts, 1 unverified)
ok         a.example.com (txid 3, freshness unknown)
ok         d.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
ok         b.example.com (txid 3, freshness unknown)
ok         e.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-b.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
ok         c.example.com (txid 3, freshness unknown)
ok         f.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-c.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
hibernate-verify: published control/verify/box-a.json (6 hosts, 6 unverified)
hibernate-verify: 0 of 0 replicas this box drills proven this run (0 visited, 6 in its record)
hibernate-verify: published control/verify/box-a.json (6 hosts, 6 unverified)
hibernate-verify: 0 of 0 replicas this box drills proven this run (0 visited, 6 in its record)
ok         a.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (5 hosts, 4 unverified)
hibernate-verify: 1 of 1 replicas this box drills proven this run (1 visited, 5 in its record)
ok         a.example.com (txid 3, freshness unknown)
ok         d.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
ok         a.example.com (txid 3, freshness unknown)
ok         b.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 0 unverified)
hibernate-verify: 2 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
ok         a.example.com (txid 3, freshness unknown)
unverified b.example.com: no_record this box has the host, but there is no instance record for it
hibernate-verify: published control/verify/box-a.json (2 hosts, 1 unverified)
hibernate-verify: 1 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
FAIL       a.example.com: restore_error lease: the restored copy failed its check: integrity_check: page 4 corrupt
unverified b.example.com: no_record this box has the host, but there is no instance record for it
hibernate-verify: published control/verify/box-a.json (2 hosts, 1 unverified)
hibernate-verify: published control/verify/box-a.json (0 hosts, 0 unverified)
hibernate-verify: no hibernating instances for this box to drill; its record is cleared
hibernate-verify: no hibernating instances for this box to drill
hibernate-verify: published control/verify/box-a.json (0 hosts, 0 unverified)
hibernate-verify: no hibernating instances for this box to drill; its record is cleared
unverified moving.example.com: moving the instance was moving when the test began
ok         stays.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (2 hosts, 1 unverified)
hibernate-verify: 1 of 2 replicas this box drills proven this run (2 visited, 2 in its record)
ok         a.example.com (txid 3, freshness unknown)
hibernate-verify: published control/verify/box-a.json (1 hosts, 0 unverified)
hibernate-verify: 1 of 1 replicas this box drills proven this run (1 visited, 1 in its record)
ok    /tmp/TestRestoreVerifyHoldsOneRestoreAtATime3128136913/002/a.db
ok    /tmp/TestRestoreVerifyHoldsOneRestoreAtATime3128136913/002/b.db
ok    /tmp/TestRestoreVerifyHoldsOneRestoreAtATime3128136913/002/c.db
restore-verify: all 3 replicas restore clean and are current
STALE /tmp/TestRestoreVerifyFailsOnAStaleReplica1132957287/001/live.db: replica is at change 3, the live database at 23, and the database has been quiet since 2026-11-26T09:22:34Z — replication has stopped
FAIL
FAIL	github.com/carlosframework/platform/internal/ops	12.885s
ok  	github.com/carlosframework/platform/internal/pageindex	3.787s
ok  	github.com/carlosframework/platform/internal/parity	0.098s
?   	github.com/carlosframework/platform/internal/parity/cmd/parity-doc	[no test files]
ok  	github.com/carlosframework/platform/internal/park	0.724s
ok  	github.com/carlosframework/platform/internal/perf	0.208s
ok  	github.com/carlosframework/platform/internal/plans	0.148s
ok  	github.com/carlosframework/platform/internal/privatefile	0.018s
ok  	github.com/carlosframework/platform/internal/provision	237.000s
ok  	github.com/carlosframework/platform/internal/proxyproto	0.943s
ok  	github.com/carlosframework/platform/internal/publicrelease	0.042s
ok  	github.com/carlosframework/platform/internal/ratelimit	0.208s
ok  	github.com/carlosframework/platform/internal/regionlabel	0.062s
ok  	github.com/carlosframework/platform/internal/regionname	0.030s
ok  	github.com/carlosframework/platform/internal/registrar	0.036s
ok  	github.com/carlosframework/platform/internal/registrar/openprovider	0.686s
?   	github.com/carlosframework/platform/internal/registrar/registrartest	[no test files]
ok  	github.com/carlosframework/platform/internal/registry	79.964s
ok  	github.com/carlosframework/platform/internal/relay	7.569s
ok  	github.com/carlosframework/platform/internal/release	95.285s
ok  	github.com/carlosframework/platform/internal/replicagen	0.081s
ok  	github.com/carlosframework/platform/internal/replicas	0.107s
ok  	github.com/carlosframework/platform/internal/reqrec	6.046s
ok  	github.com/carlosframework/platform/internal/rollout	11.966s
ok  	github.com/carlosframework/platform/internal/rolloutwords	0.043s
ok  	github.com/carlosframework/platform/internal/rootaws	96.777s
ok  	github.com/carlosframework/platform/internal/rootfsimage	0.767s
ok  	github.com/carlosframework/platform/internal/rootparticipation	0.095s
ok  	github.com/carlosframework/platform/internal/rootstate	0.043s
ok  	github.com/carlosframework/platform/internal/runs	0.748s
ok  	github.com/carlosframework/platform/internal/s3compat	0.058s
ok  	github.com/carlosframework/platform/internal/s3fake	1.237s
ok  	github.com/carlosframework/platform/internal/safefile	0.011s
ok  	github.com/carlosframework/platform/internal/schedule	22.552s
ok  	github.com/carlosframework/platform/internal/seeds	0.107s
ok  	github.com/carlosframework/platform/internal/sim/litestreamfacts	4.964s
ok  	github.com/carlosframework/platform/internal/sim/mediajobs	50.358s
ok  	github.com/carlosframework/platform/internal/sim/regionha	20.940s
ok  	github.com/carlosframework/platform/internal/status	0.382s
ok  	github.com/carlosframework/platform/internal/steering	0.264s
ok  	github.com/carlosframework/platform/internal/stopevidence	0.514s
ok  	github.com/carlosframework/platform/internal/storecfg	0.416s
ok  	github.com/carlosframework/platform/internal/svcrole	0.006s
ok  	github.com/carlosframework/platform/internal/systemd	5.565s
?   	github.com/carlosframework/platform/internal/systemdshow	[no test files]
ok  	github.com/carlosframework/platform/internal/team	3.317s
ok  	github.com/carlosframework/platform/internal/teamcontract	0.181s
ok  	github.com/carlosframework/platform/internal/telemetry	0.021s
ok  	github.com/carlosframework/platform/internal/termfence	2.611s
ok  	github.com/carlosframework/platform/internal/timerspec	0.015s
ok  	github.com/carlosframework/platform/internal/tsidentity	4.141s
ok  	github.com/carlosframework/platform/internal/tunnelclient	0.386s
ok  	github.com/carlosframework/platform/internal/unixdial	0.009s
ok  	github.com/carlosframework/platform/internal/updatewords	0.035s
ok  	github.com/carlosframework/platform/internal/upstreamguard	0.022s
?   	github.com/carlosframework/platform/internal/upstreamguard/guardtest	[no test files]
ok  	github.com/carlosframework/platform/internal/usage	0.023s
ok  	github.com/carlosframework/platform/internal/version	0.010s
ok  	github.com/carlosframework/platform/internal/vet	2.903s
ok  	github.com/carlosframework/platform/internal/zonehost	0.039s
ok  	github.com/carlosframework/platform/internal/zonehost/route53zones	0.060s
?   	github.com/carlosframework/platform/internal/zonehost/zonehosttest	[no test files]
?   	github.com/carlosframework/platform/scripts/gitleaks-gate	[no test files]
ok  	github.com/carlosframework/platform/scripts/govulncheck-gate	0.016s
ok  	github.com/carlosframework/platform/scripts/pathmapcheck	0.121s
ok  	github.com/carlosframework/platform/scripts/region-ha-g2/fixture	5.215s
ok  	github.com/carlosframework/platform/scripts/stateless-replicas-drill	1.230s
ok  	github.com/carlosframework/platform/scripts/witness-pointer	0.021s
FAIL
=== cutover-witness (160 s, from +15 s)
ok  	github.com/carlosframework/platform	1.958s
=== internal_grouproll@0 (273 s, from +75 s)
ok  	github.com/carlosframework/platform/internal/grouproll	272.716s
=== internal_grouproll@1 (280 s, from +75 s)
ok  	github.com/carlosframework/platform/internal/grouproll	279.150s
=== internal_activator@0 (155 s, from +149 s)
ok  	github.com/carlosframework/platform/internal/activator	151.539s
=== internal_activator@1 (132 s, from +149 s)
ok  	github.com/carlosframework/platform/internal/activator	128.772s
=== internal_activator@2 (134 s, from +149 s)
ok  	github.com/carlosframework/platform/internal/activator	130.174s
=== internal_activator@3 (169 s, from +149 s)
ok  	github.com/carlosframework/platform/internal/activator	165.661s
=== root@0 (121 s, from +178 s)
ok  	github.com/carlosframework/platform	110.334s
=== root@1 (110 s, from +178 s)
ok  	github.com/carlosframework/platform	100.302s
=== root@2 (119 s, from +178 s)
ok  	github.com/carlosframework/platform	109.774s
=== root@3 (107 s, from +178 s)
ok  	github.com/carlosframework/platform	99.823s
=== root@4 (105 s, from +178 s)
ok  	github.com/carlosframework/platform	95.410s
=== internal_edge@0 (252 s, from +179 s)
ok  	github.com/carlosframework/platform/internal/edge	242.888s
=== internal_edge@1 (127 s, from +180 s)
ok  	github.com/carlosframework/platform/internal/edge	118.796s
=== internal_edge@2 (151 s, from +180 s)
ok  	github.com/carlosframework/platform/internal/edge	142.648s
=== internal_edge@3 (150 s, from +180 s)
ok  	github.com/carlosframework/platform/internal/edge	141.137s
=== internal_host@0 (179 s, from +222 s)
ok  	github.com/carlosframework/platform/internal/host	175.075s
=== internal_host@1 (140 s, from +222 s)
ok  	github.com/carlosframework/platform/internal/host	135.641s
=== internal_host@2 (216 s, from +222 s)
ok  	github.com/carlosframework/platform/internal/host	212.157s
=== internal_host@3 (230 s, from +222 s)
ok  	github.com/carlosframework/platform/internal/host	225.587s
=== internal_host@4 (264 s, from +222 s)
ok  	github.com/carlosframework/platform/internal/host	259.813s
=== internal_host@5 (147 s, from +222 s)
ok  	github.com/carlosframework/platform/internal/host	142.824s
=== internal_console@0 (157 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	150.657s
=== internal_console@1 (164 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	156.957s
=== internal_console@2 (232 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	226.053s
=== internal_console@3 (244 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	237.558s
=== internal_console@4 (202 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	196.021s
=== internal_console@5 (214 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	207.682s
=== internal_console@6 (200 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	193.089s
=== internal_console@7 (208 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	201.570s
=== internal_console@8 (217 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	209.270s
=== internal_console@9 (218 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	211.086s
=== internal_console@10 (225 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	218.276s
=== internal_console@11 (206 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	198.660s
=== internal_console@12 (293 s, from +227 s)
ok  	github.com/carlosframework/platform/internal/console	286.249s
=== internal_console@13 (207 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	201.059s
=== internal_console@14 (240 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	234.945s
=== internal_console@15 (211 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	205.522s
=== internal_console@16 (235 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	228.115s
=== internal_console@17 (199 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	193.982s
=== internal_console@18 (223 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	216.896s
=== internal_console@19 (203 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	197.916s
=== internal_console@20 (232 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	226.409s
=== internal_console@21 (251 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	244.465s
=== internal_console@22 (221 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	214.839s
=== internal_console@23 (227 s, from +228 s)
ok  	github.com/carlosframework/platform/internal/console	221.557s
=== lists: internal_console 226 s, internal_edge 178 s, internal_activator 148 s, internal_host 221 s, root 176 s, internal_grouproll 74 s
=== cpu: the gate used 12915 cpu-seconds in 520 s, about 24.8 of 32 cores; the machine as a whole was 83% busy

Failure summary:
--- rest
FAIL       a.example.com: restore_error restore: decode database: decode page 3: file checksum mismatch
FAIL       a.example.com: restore_error restore: decode database: decode header: unmarshal header: invalid LTX file
FAIL       a.example.com: restore_error lease: the restored copy failed its check: integrity_check: page 4 corrupt
FAIL       a.example.com: restore_error restore: ltx file corrupted
--- FAIL: TestVerifyHibernatingReplansAMissingObject (0.01s)
    --- FAIL: TestVerifyHibernatingReplansAMissingObject/contents_gone_once (0.01s)
        hibernate_verify_restore_test.go:161: planned 1 times over 1 resolutions, want once and one replan over one (G4)
FAIL       a.example.com: restore_error integrity_check: *** in database main ***
FAIL       damaged.example.com: restore_error lease: the restored copy failed its check: integrity_check: page 4 corrupt
FAIL       frozen.example.com: stale replica is at change 2, the live database at 31, and the database has been quiet since 2026-11-26T09:22:29Z — replication has stopped
FAIL       a.example.com: stale replica is at change 2, the live database at 31, and the database has been quiet since 2026-11-26T09:22:29Z — replication has stopped
FAIL       a.example.com: restore_error lease: the restored copy failed its check: integrity_check: page 4 corrupt
FAIL	github.com/carlosframework/platform/internal/ops	12.885s

FAILED: rest
make: *** [Makefile:23: test] Error 1
=== opentofu ===
opentofu: 39 test files in 11 suites, OpenTofu v1.13.9
  initialised in 15 s
  ok      16 s  infra/modules/box-fence-writer/tests/writer.tftest.hcl  Success! 1 passed, 0 failed.
  ok      21 s  infra/modules/deployment-buckets/tests/console_floors.tftest.hcl  Success! 1 passed, 0 failed.
  ok      28 s  infra/modules/deployment-buckets/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      17 s  infra/modules/deployment-buckets/tests/db_reads.tftest.hcl  Success! 1 passed, 0 failed.
  ok      17 s  infra/modules/deployment-buckets/tests/evidence.tftest.hcl  Success! 1 passed, 0 failed.
  ok      30 s  infra/modules/deployment-buckets/tests/fence_writers.tftest.hcl  Success! 3 passed, 0 failed.
  ok      23 s  infra/modules/deployment-buckets/tests/media_results.tftest.hcl  Success! 2 passed, 0 failed.
  ok      92 s  infra/modules/media-engine/tests/media_engine.tftest.hcl  Success! 24 passed, 0 failed.
  ok      29 s  infra/modules/pdf-host/tests/computed.tftest.hcl  Success! 2 passed, 0 failed.
  ok      58 s  infra/modules/pdf-host/tests/pdf_host.tftest.hcl  Success! 24 passed, 0 failed.
  ok      44 s  infra/modules/region-group-operator-document/tests/document.tftest.hcl  Success! 12 passed, 0 failed.
  ok      20 s  infra/modules/region-host/ingress/tests/fixed-targets/tests/targets.tftest.hcl  Success! 2 passed, 0 failed.
  ok      68 s  infra/modules/region-host/ingress/tests/group_ingress.tftest.hcl  Success! 30 passed, 0 failed.
  ok      47 s  infra/modules/region-host/tests/alert_publish.tftest.hcl  Success! 18 passed, 0 failed.
  ok      42 s  infra/modules/region-host/tests/alerts_topic.tftest.hcl  Success! 16 passed, 0 failed.
  ok      12 s  infra/modules/region-host/tests/analytics_prune.tftest.hcl  Success! 2 passed, 0 failed.
  ok      14 s  infra/modules/region-host/tests/console_mail.tftest.hcl  Success! 4 passed, 0 failed.
  ok       6 s  infra/modules/region-host/tests/fixed_state_unchanged.tftest.hcl  Success! 1 passed, 0 failed.
  ok      72 s  infra/modules/region-host/tests/group.tftest.hcl  Success! 32 passed, 0 failed.
  ok      10 s  infra/modules/region-host/tests/group_alarms.tftest.hcl  Success! 4 passed, 0 failed.
  ok      12 s  infra/modules/region-host/tests/group_iam.tftest.hcl  Success! 4 passed, 0 failed.
  ok       6 s  infra/modules/region-host/tests/group_isolation.tftest.hcl  Success! 1 passed, 0 failed.
  ok      37 s  infra/modules/region-host/tests/group_operator.tftest.hcl  Success! 13 passed, 0 failed.
  ok      10 s  infra/modules/region-host/tests/group_user_data.tftest.hcl  Success! 3 passed, 0 failed.
  ok      30 s  infra/modules/region-host/tests/health_alarms.tftest.hcl  Success! 10 passed, 0 failed.
  ok      16 s  infra/modules/region-host/tests/ingress_drain_read.tftest.hcl  Success! 4 passed, 0 failed.
  ok       5 s  infra/modules/region-host/tests/instance_metadata.tftest.hcl  Success! 1 passed, 0 failed.
  ok      26 s  infra/modules/region-host/tests/mailer.tftest.hcl  Success! 6 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/mailer_group.tftest.hcl  Success! 2 passed, 0 failed.
  ok      12 s  infra/modules/region-host/tests/managed_fleets/group_refusal.tftest.hcl  Success! 2 passed, 0 failed.
  ok     103 s  infra/modules/region-host/tests/managed_fleets/managed_fleets.tftest.hcl  Success! 46 passed, 0 failed.
  ok      69 s  infra/modules/region-host/tests/store_conversion.tftest.hcl  Success! 27 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/store_scanning.tftest.hcl  Success! 4 passed, 0 failed.
  ok      28 s  infra/modules/region-host/tests/store_versioning.tftest.hcl  Success! 11 passed, 0 failed.
  ok      15 s  infra/modules/region-host/tests/store_write_credentials.tftest.hcl  Success! 4 passed, 0 failed.
  ok      18 s  infra/modules/region-host/tests/user_data_ignored.tftest.hcl  Success! 3 passed, 0 failed.
  ok      11 s  infra/modules/region-remote-host/tests/data_lifecycle.tftest.hcl  Success! 3 passed, 0 failed.
  ok      17 s  infra/modules/region-remote-host/tests/no_deployment_bucket.tftest.hcl  Success! 5 passed, 0 failed.
  ok      29 s  infra/modules/scanner-host/tests/scanner_host.tftest.hcl  Success! 14 passed, 0 failed.
opentofu: 39 files in 209 s
opentofu: PASS

amadan: step gate failed: exit status 2

amadan: job failed at step gate — its output is above, not at the tail of this log
diff --git a/docs/superpowers/notes/census-proposal-litestream-0518-1443.md b/docs/superpowers/notes/census-proposal-litestream-0518-1443.md
new file mode 100644
index 000000000..b459231e7
--- /dev/null
+++ b/docs/superpowers/notes/census-proposal-litestream-0518-1443.md
@@ -0,0 +1,11 @@
+# Census approval: litestream-0518-1443
+
+Ruling `census-ruling-litestream-0518-1443`. The independent reviewer approves or rejects every change below, 0 with a new disposition; nothing goes to the census owner (Paul, #280, 2026-10-26).
+
+Envelopes re-pinned: `.`, `internal/dbdoor`, `internal/lease`.
+
+Review: a model from the other family than the author reads the branch's diff against main on the amadan.net remote (`origin` or `amadan`, whichever points at amadan.net) and gives a verdict for every unit and every re-pinned envelope above. For a unit, compare the change with its recorded disposition and basis below; for an envelope, read every changed function in the package and what it reaches. Reject if the change lets root open, run, query or follow anything it did not before from a path or input a tenant, an app or a box agent can create, write or name; if it weakens a check, refusal, validation, argument or environment the basis relies on; or if the diff cannot settle either. Otherwise approve. Record each verdict on #280 with the tip. A rejected unit goes back to the author to correct; nothing escalates to the census owner.
+
+Seal: `ce6e123ac6a66f77f39ca4047576789f31868b5422c6a9a67231e82c71a14764` → `ce6e123ac6a66f77f39ca4047576789f31868b5422c6a9a67231e82c71a14764`.
+
+Overlay: `internal/provision/testdata/plan14-root-reads-litestream-0518-1443.tsv`, appended to `internal/provision/testdata/plan14-root-reads-chain.tsv`.
diff --git a/go.mod b/go.mod
index fe142fbdb..de4b79c2d 100644
--- a/go.mod
+++ b/go.mod
@@ -22,12 +22,12 @@ require (
github.com/aws/aws-sdk-go-v2/service/ssm v1.74.0
github.com/aws/aws-sdk-go-v2/service/sts v1.45.6
github.com/aws/smithy-go v1.28.1
- github.com/benbjohnson/litestream v0.5.14
+ github.com/benbjohnson/litestream v0.5.18
github.com/mattn/go-isatty v0.0.20
github.com/pion/logging v0.2.4
github.com/pion/stun/v3 v3.1.5
github.com/pion/turn/v4 v4.1.4
- github.com/superfly/ltx v0.5.1
+ github.com/superfly/ltx v0.5.2
golang.org/x/crypto v0.58.0
golang.org/x/crypto/x509roots/fallback v0.0.0-20260209214922-2f26647a795e
golang.org/x/net v0.62.0
@@ -64,15 +64,15 @@ require (
github.com/markusmobius/go-dateparser v1.2.4 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/ncruces/go-strftime v1.0.0 // indirect
- github.com/pierrec/lz4/v4 v4.1.22 // indirect
+ github.com/pierrec/lz4/v4 v4.1.34 // indirect
github.com/pion/dtls/v3 v3.1.4 // indirect
github.com/pion/randutil v0.1.0 // indirect
github.com/pion/transport/v4 v4.0.2 // indirect
github.com/prometheus/client_golang v1.17.0 // indirect
- github.com/prometheus/client_model v0.5.0 // indirect
+ github.com/prometheus/client_model v0.6.2 // indirect
github.com/prometheus/common v0.45.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
- github.com/psanford/sqlite3vfs v0.0.0-20251127171934-4e34e03a991a // indirect
+ github.com/psanford/sqlite3vfs v0.0.0-20260519004904-f9180fa2acc9 // indirect
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
github.com/tetratelabs/wazero v1.2.1 // indirect
github.com/ulikunitz/xz v0.5.10 // indirect
@@ -81,7 +81,7 @@ require (
golang.org/x/mod v0.41.0 // indirect
golang.org/x/sync v0.24.0 // indirect
golang.org/x/text v0.43.0 // indirect
- google.golang.org/protobuf v1.36.10 // indirect
+ google.golang.org/protobuf v1.36.11 // indirect
modernc.org/libc v1.74.1 // indirect
modernc.org/mathutil v1.7.1 // indirect
modernc.org/memory v1.11.0 // indirect
diff --git a/go.sum b/go.sum
index 4e50516c3..b5bcd7d09 100644
--- a/go.sum
+++ b/go.sum
@@ -1,11 +1,14 @@
cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM=
cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4=
+cloud.google.com/go v0.121.6 h1:waZiuajrI28iAf40cWgycWNgaXPO06dupuS+sgibK6c=
cloud.google.com/go/compute/metadata v0.9.0 h1:pDUj4QMoPejqq20dK0Pg2N4yG9zIkYGdBtwLoEkH9Zs=
cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10=
cloud.google.com/go/iam v1.1.5 h1:1jTsCu4bcsNsE4iiqNT5SHwrDRCfRmIaaaVFhRveTJI=
cloud.google.com/go/iam v1.1.5/go.mod h1:rB6P/Ic3mykPbFio+vo7403drjlgvoWfYpJhMXEbzv8=
+cloud.google.com/go/iam v1.5.3 h1:+vMINPiDF2ognBJ97ABAYYwRgsaqxPbQDlMnbHMjolc=
cloud.google.com/go/storage v1.36.0 h1:P0mOkAcaJxhCTvAkMhxMfrTKiNcub4YmmPBtlhAyTr8=
cloud.google.com/go/storage v1.36.0/go.mod h1:M6M/3V/D3KpzMTJyPOR/HU6n2Si5QdaXYEsng2xgOs8=
+cloud.google.com/go/storage v1.56.0 h1:iixmq2Fse2tqxMbWhLWC9HfBj1qdxqAmiK8/eqtsLxI=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2 h1:Hr5FTipp7SL07o2FvoVOX9HRiRH3CR3Mj8pxqCcdD5A=
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.18.2/go.mod h1:QyVsSSN64v5TGltphKLQ2sQxe4OBQg0J1eKRcVBnfgE=
github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.11.0 h1:MhRfI58HblXzCtWEZCO0feHs8LweePB3s90r7WaR1KU=
@@ -90,24 +93,29 @@ github.com/aws/smithy-go v1.28.1 h1:R/nXH00c8qcfCzQVELtRw+eLQWtzv+VAIEFJ1/xxXlQ=
github.com/aws/smithy-go v1.28.1/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc=
github.com/benbjohnson/litestream v0.5.14 h1:pu2RCUfEs2MfAvxSttNg/kVVzJspqg2sX/pPW3Elzxc=
github.com/benbjohnson/litestream v0.5.14/go.mod h1:aN5OtdkcCz07xVjCbmMWOGUSIdPumpqBYtdyrzNMhOI=
+github.com/benbjohnson/litestream v0.5.18 h1:kelmbbFQvlgrm8dRrpt9bqvDrJ69OgWQca8hSflNF2U=
+github.com/benbjohnson/litestream v0.5.18/go.mod h1:4qjd9UcvoyYExdJPMqpoGUjeg7th7RU6DKqn/+NclpI=
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs=
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
+github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo=
github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE=
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
+github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
@@ -117,12 +125,15 @@ github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e h1:ijClszYn+mADRFY17k
github.com/google/pprof v0.0.0-20250317173921-a4b03ec1a45e/go.mod h1:boTsfXsheKC2y+lKOCMpSfarhxDeIzfZG1jqGcPl3cA=
github.com/google/s2a-go v0.1.7 h1:60BLSyTrOV4/haCDW4zb1guZItoSq8foHCXrAnjBo/o=
github.com/google/s2a-go v0.1.7/go.mod h1:50CgR4k1jNlWBu4UfS4AcfhVe1r6pdZPygJ3R8F0Qdw=
+github.com/google/s2a-go v0.1.9 h1:LGD7gtMgezd8a/Xak7mEWL0PjoTQFvpRudN895yqKW0=
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/googleapis/enterprise-certificate-proxy v0.3.4 h1:XYIDZApgAnrN1c855gTgghdIA6Stxb52D5RnLI1SLyw=
github.com/googleapis/enterprise-certificate-proxy v0.3.4/go.mod h1:YKe7cfqYXjKGpGvmSg28/fFvhNzinZQm8DGnaburhGA=
+github.com/googleapis/enterprise-certificate-proxy v0.3.11 h1:vAe81Msw+8tKUxi2Dqh/NZMz7475yUvmRIkXr4oN2ao=
github.com/googleapis/gax-go/v2 v2.12.0 h1:A+gCJKdRfqXkr+BIRGtZLibNXf0m1f9E4HG56etFpas=
github.com/googleapis/gax-go/v2 v2.12.0/go.mod h1:y+aIqrI5eb1YGMVJfuV3185Ts/D7qKpsEkdD5+I6QGU=
+github.com/googleapis/gax-go/v2 v2.17.0 h1:RksgfBpxqff0EZkDWYuz9q/uWsTVz+kf43LsZ1J6SMc=
github.com/hablullah/go-hijri v1.0.2 h1:drT/MZpSZJQXo7jftf5fthArShcaMtsal0Zf/dnmp6k=
github.com/hablullah/go-hijri v1.0.2/go.mod h1:OS5qyYLDjORXzK4O1adFw9Q5WfhOcMdAKglDkcTxgWQ=
github.com/hablullah/go-juliandays v1.0.0 h1:A8YM7wIj16SzlKT0SRJc9CD29iiaUzpBLzh5hr0/5p0=
@@ -168,6 +179,8 @@ github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5
github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8=
github.com/pierrec/lz4/v4 v4.1.22 h1:cKFw6uJDK+/gfw5BcDL0JL5aBsAFdsIT18eRtLj7VIU=
github.com/pierrec/lz4/v4 v4.1.22/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
+github.com/pierrec/lz4/v4 v4.1.34 h1:5cPY8+z/ffHDpF6Pvv5FffjtZOJJQEiG75267Ol3QtU=
+github.com/pierrec/lz4/v4 v4.1.34/go.mod h1:R7aiqKav9M7+k1JW19D7y7rcavDvw9Te/YTdFJyNXBs=
github.com/pion/dtls/v3 v3.1.4 h1:QhvtMflMfu9Kf0RcDC5BJBle4caPskByrKQR6uuYqpY=
github.com/pion/dtls/v3 v3.1.4/go.mod h1:cr/qotLISUw/9C1m83ZPNZtj9WnXkYLpfCptPqbkInc=
github.com/pion/logging v0.2.4 h1:tTew+7cmQ+Mc1pTBLKH2puKsOvhm32dROumOZ655zB8=
@@ -186,16 +199,21 @@ github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q=
github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY=
github.com/prometheus/client_model v0.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw=
github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI=
+github.com/prometheus/client_model v0.6.2 h1:oBsgwpGs7iVziMvrGhE53c/GrLUsZdHnqNwqPLxwZyk=
+github.com/prometheus/client_model v0.6.2/go.mod h1:y3m2F6Gdpfy6Ut/GBsUqTWZqCUvMVzSfMLjcu6wAwpE=
github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM=
github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY=
github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo=
github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo=
github.com/psanford/sqlite3vfs v0.0.0-20251127171934-4e34e03a991a h1:r4YWl0uVObCbBFvj1VsIlyHzgZwZOHvY1KdRaQjzzUc=
github.com/psanford/sqlite3vfs v0.0.0-20251127171934-4e34e03a991a/go.mod h1:iW4cSew5PAb1sMZiTEkVJAIBNrepaB6jTYjeP47WtI0=
+github.com/psanford/sqlite3vfs v0.0.0-20260519004904-f9180fa2acc9 h1:9bBMbcwroL46feESdJWjRX0GV+k8o/P9gAg9UX6Vz7U=
+github.com/psanford/sqlite3vfs v0.0.0-20260519004904-f9180fa2acc9/go.mod h1:iW4cSew5PAb1sMZiTEkVJAIBNrepaB6jTYjeP47WtI0=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
@@ -204,6 +222,8 @@ github.com/studio-b12/gowebdav v0.11.0 h1:qbQzq4USxY28ZYsGJUfO5jR+xkFtcnwWgitp4Z
github.com/studio-b12/gowebdav v0.11.0/go.mod h1:bHA7t77X/QFExdeAnDzK6vKM34kEZAcE1OX4MfiwjkE=
github.com/superfly/ltx v0.5.1 h1:vGUeBhKvBKZ2s2TsTrOSahz+m0PswfqOWDAD+ICiiYY=
github.com/superfly/ltx v0.5.1/go.mod h1:Nf50QAIXU/ET4ua3AuQ2fh31MbgNQZA7r/DYx6Os77s=
+github.com/superfly/ltx v0.5.2 h1:XVzytSsIlpUaOd2I7M40lDhUQIzGIdqkLBNg5M5Ax48=
+github.com/superfly/ltx v0.5.2/go.mod h1:0OtLSLHHHPa3qDrAmwkLW5pUBfj365JS+bR9FEJDrM4=
github.com/tetratelabs/wazero v1.2.1 h1:J4X2hrGzJvt+wqltuvcSjHQ7ujQxA9gb6PeMs4qlUWs=
github.com/tetratelabs/wazero v1.2.1/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ=
github.com/ulikunitz/xz v0.5.10 h1:t92gobL9l3HE202wg3rlk19F6X+JOxl9BBrCCMYEYd8=
@@ -220,14 +240,19 @@ go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0 h1:r6I7RJCN86bpD/FQwedZ0vSixDpwuWREjW9oRMsmqDc=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.54.0/go.mod h1:B9yO6b04uB80CzjedvewuqDhxJxi11s7/GtiGa8bAjI=
+go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.61.0 h1:q4XOmH/0opmeuJtPsbFNivyl7bCt7yRBbeEm2sC/XtQ=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0/go.mod h1:L7UH0GbB0p47T4Rri3uHjbpCFYrVrwc1I25QhNPiGK8=
+go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 h1:F7Jx+6hwnZ41NSFTO5q4LYDtJRXBf2PD0rNBkeB/lus=
go.opentelemetry.io/otel v1.39.0 h1:8yPrr/S0ND9QEfTfdP9V+SiwT4E0G7Y5MO7p85nis48=
go.opentelemetry.io/otel v1.39.0/go.mod h1:kLlFTywNWrFyEdH0oj2xK0bFYZtHRYUdv1NklR/tgc8=
+go.opentelemetry.io/otel v1.45.0 h1:pdrWmLHofpubmArBv1LgFSv1Z0Ie/ppdZzu+kUN5EeU=
go.opentelemetry.io/otel/metric v1.39.0 h1:d1UzonvEZriVfpNKEVmHXbdf909uGTOQjA0HF0Ls5Q0=
go.opentelemetry.io/otel/metric v1.39.0/go.mod h1:jrZSWL33sD7bBxg1xjrqyDjnuzTUB0x1nBERXd7Ftcs=
+go.opentelemetry.io/otel/metric v1.45.0 h1:7Eg1uH7CJ5cXv9is6tnBe1FI6rj1nwUdbFypRm3br/M=
go.opentelemetry.io/otel/trace v1.39.0 h1:2d2vfpEDmCJ5zVYz7ijaJdOF59xLomrvj7bjt6/qCJI=
go.opentelemetry.io/otel/trace v1.39.0/go.mod h1:88w4/PnZSazkGzz/w84VHpQafiU4EtqqlVdxWy+rNOA=
+go.opentelemetry.io/otel/trace v1.45.0 h1:l/mP6Uv7oNO7/TblbhpbgMidxhq1uO/rPsikOyVhxag=
golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M=
golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA=
golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54=
@@ -242,6 +267,7 @@ golang.org/x/net v0.62.0 h1:18ELalfM5+XNRwzM2nYqXsZQ9ByS1uhj2O/U7+5jqRY=
golang.org/x/net v0.62.0/go.mod h1:WgDCOTH8iwtB66T4/GfI94AHo/hhdb7Hah9NDseQfiI=
golang.org/x/oauth2 v0.34.0 h1:hqK/t4AKgbqWkdkcAeI8XLmbK+4m4G5YeQRrmiotGlw=
golang.org/x/oauth2 v0.34.0/go.mod h1:lzm5WQJQwKZ3nwavOZ3IS5Aulzxi68dUSgRHujetwEA=
+golang.org/x/oauth2 v0.36.0 h1:peZ/1z27fi9hUOFCAZaHyrpWG5lwe0RJEEEeH0ThlIs=
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk=
golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0=
@@ -268,16 +294,23 @@ golang.org/x/tools v0.51.0/go.mod h1:9eEncMayCV6zRMGhR5eZEC2iBx98qWcF1HZ9Z7wJOoA
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/api v0.155.0 h1:vBmGhCYs0djJttDNynWo44zosHlPvHmA0XiN2zP2DtA=
google.golang.org/api v0.155.0/go.mod h1:GI5qK5f40kCpHfPn6+YzGAByIKWv8ujFnmoWm7Igduk=
+google.golang.org/api v0.264.0 h1:+Fo3DQXBK8gLdf8rFZ3uLu39JpOnhvzJrLMQSoSYZJM=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg=
google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k=
+google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 h1:VQZ/yAbAtjkHgH80teYd2em3xtIkkHd7ZhqfH2N9CsM=
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 h1:fCvbg86sFXwdrl5LgVcTEvNC+2txB5mgROGmRL5mrls=
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:+rXWjjaukWZun3mLfjmVnQi18E1AsFbDN9QdJ5YXLto=
+google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa h1:Kjn0N0tCrDgiAFW+lGO4JZ3ck44CehvJQMAwj9QF0G8=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217 h1:gRkg/vSppuSQoDjxyiGfN4Upv/h/DQmIR10ZU8dh4Ww=
google.golang.org/genproto/googleapis/rpc v0.0.0-20251202230838-ff82c1b0f217/go.mod h1:7i2o+ce6H/6BluujYR+kqX3GKH+dChPTQU19wjRPiGk=
+google.golang.org/genproto/googleapis/rpc v0.0.0-20260526163538-3dc84a4a5aaa h1:mZHHdPZl0dbGHCflZgAq/Q468DWVFcU2whhB2KAo8fk=
google.golang.org/grpc v1.79.3 h1:sybAEdRIEtvcD68Gx7dmnwjZKlyfuc61Dyo9pGXXkKE=
google.golang.org/grpc v1.79.3/go.mod h1:KmT0Kjez+0dde/v2j9vzwoAScgEPx/Bw1CYChhHLrHQ=
+google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU=
google.golang.org/protobuf v1.36.10 h1:AYd7cD/uASjIL6Q9LiTjz8JLcrh/88q5UObnmY3aOOE=
google.golang.org/protobuf v1.36.10/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
+google.golang.org/protobuf v1.36.11 h1:fV6ZwhNocDyBLK0dj+fg8ektcVegBBuEolpbTQyBNVE=
+google.golang.org/protobuf v1.36.11/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
modernc.org/cc/v4 v4.29.0 h1:CXgwL8cvxmyzBQZzbSl/6xFtMCryb6u8IOqDci39cgc=
diff --git a/internal/dbdoor/restore.go b/internal/dbdoor/restore.go
index 427bbc1a5..8e13f8545 100644
--- a/internal/dbdoor/restore.go
+++ b/internal/dbdoor/restore.go
@@ -300,8 +300,12 @@ func removeCopy(out string) {
// newest file opened is the copy's "as of" (R1).
type recorder struct {
*Client
- dir string // the private directory each file is downloaded into
- mu sync.Mutex
+ dir string // the private directory each file is downloaded into
+ mu sync.Mutex
+ // dl holds the door to one file stream at a time: from litestream
+ // 0.5.18 a restore opens up to 32 planned files at once, and the door
+ // bounds a person's concurrent streams (apidb.go).
+ dl sync.Mutex
vanished bool
checkFailed bool
at time.Time // the as-of time; zero for the newest copy
@@ -355,7 +359,9 @@ func (r *recorder) OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID
// The first open goes through download's loop too, so a full door's
// 429 waits out its Retry-After here rather than failing back to
// litestream, whose own quick retries ignore it.
+ r.dl.Lock()
rc, err := r.download(ctx, nil, level, minTXID, maxTXID, offset, size)
+ r.dl.Unlock()
if err != nil {
return nil, err
}
diff --git a/internal/dbdoor/restore_test.go b/internal/dbdoor/restore_test.go
index dc4dedba1..cd1d22d5e 100644
--- a/internal/dbdoor/restore_test.go
+++ b/internal/dbdoor/restore_test.go
@@ -85,8 +85,11 @@ func TestRestoreToRetriesTheWholeRestoreOnce(t *testing.T) {
t.Fatalf("RestoreTo with a file vanishing once = %v, want success on a fresh plan", err)
}
defer os.RemoveAll(got.Dir)
- if door.lists[9] != 2 {
- t.Fatalf("snapshot level listed %d times, want 2 (one plan per Restore)", door.lists[9])
+ // The fresh plan is litestream's own from 0.5.18 (Restore re-plans a
+ // vanished file itself), else RestoreTo's whole-restore retry; either
+ // way at most one more listing.
+ if n := door.lists[9]; n < 1 || n > 2 {
+ t.Fatalf("snapshot level listed %d times, want 1 or 2 (at most one re-plan)", n)
}
if rows := countRows(t, got.Path); rows != 2*dbdoortest.Rows {
t.Fatalf("restored %d rows, want %d", rows, 2*dbdoortest.Rows)
diff --git a/internal/lease/check_test.go b/internal/lease/check_test.go
index 22715bf2f..8cc879247 100644
--- a/internal/lease/check_test.go
+++ b/internal/lease/check_test.go
@@ -512,7 +512,9 @@ type vanishingClient struct {
func (c *vanishingClient) OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, offset, size int64) (io.ReadCloser, error) {
path := filepath.Join(c.dir, "ltx", fmt.Sprint(level), ltx.FormatFilename(minTXID, maxTXID))
- if err := os.Remove(path); err != nil {
+ // litestream 0.5.18 opens a vanished file again when it re-plans, so
+ // one already gone is the vanish itself, not the fixture failing.
+ if err := os.Remove(path); err != nil && !errors.Is(err, os.ErrNotExist) {
return nil, fmt.Errorf("fixture: %w", err)
}
return c.ReplicaClient.OpenLTXFile(ctx, level, minTXID, maxTXID, offset, size)
diff --git a/internal/lease/claimgeneration.go b/internal/lease/claimgeneration.go
index 9fa2ab2c8..a60b7c473 100644
--- a/internal/lease/claimgeneration.go
+++ b/internal/lease/claimgeneration.go
@@ -168,9 +168,7 @@ func (c *generationClient) OpenLTXFile(ctx context.Context, level int, min, max
return &generationReader{ReadCloser: rc, cancel: cancel}, nil
}
func (c *generationClient) WriteLTXFile(ctx context.Context, level int, min, max ltx.TXID, r io.Reader) (*ltx.FileInfo, error) {
- if pipe, ok := r.(*io.PipeReader); ok {
- defer pipe.Close()
- }
+ defer closePipeBody(r)
if err := generationCoords(level, min, max); err != nil || r == nil {
return nil, ErrGenerationBinding
}
diff --git a/internal/lease/claimgeneration_snapshot_linux_test.go b/internal/lease/claimgeneration_snapshot_linux_test.go
index 3d826ad3c..cfc0b0331 100644
--- a/internal/lease/claimgeneration_snapshot_linux_test.go
+++ b/internal/lease/claimgeneration_snapshot_linux_test.go
@@ -3,7 +3,6 @@ package lease
import (
"context"
"errors"
- "io"
"path/filepath"
"testing"
@@ -31,8 +30,7 @@ func TestGenerationRefusedSnapshotReleasesWAL(t *testing.T) {
if err != nil {
t.Fatal(err)
}
- pipe := reader.(*io.PipeReader)
- t.Cleanup(func() { pipe.Close() })
+ t.Cleanup(func() { reader.Close() })
// The encoder (litestream's goroutine) opens the WAL on its own
// schedule, and later closes it as it returns: the waits are for
// the descriptor itself, and only a real bug meets their guard (#1193).
diff --git a/internal/lease/fencegate.go b/internal/lease/fencegate.go
index 80082bd96..b78217e8d 100644
--- a/internal/lease/fencegate.go
+++ b/internal/lease/fencegate.go
@@ -124,9 +124,7 @@ func (g *fenceGate) OpenLTXFile(ctx context.Context, level int, minTXID, maxTXID
// would leave its encoder blocked on the pipe, holding the WAL open for
// the life of the process (#1193).
func (g *fenceGate) WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error) {
- if pipe, ok := r.(*io.PipeReader); ok {
- defer pipe.Close()
- }
+ defer closePipeBody(r)
ctx, release, err := g.admit(ctx)
if err != nil {
return nil, err
diff --git a/internal/lease/resolve.go b/internal/lease/resolve.go
index 8b4d408f8..c8f41638a 100644
--- a/internal/lease/resolve.go
+++ b/internal/lease/resolve.go
@@ -172,9 +172,7 @@ func (r readOnlyReplica) OpenLTXFile(ctx context.Context, level int, minTXID, ma
}
func (r readOnlyReplica) WriteLTXFile(_ context.Context, _ int, _, _ ltx.TXID, rd io.Reader) (*ltx.FileInfo, error) {
- if pipe, ok := rd.(*io.PipeReader); ok {
- pipe.Close() // never leave a writer blocked on a refused upload
- }
+ closePipeBody(rd) // never leave a writer blocked on a refused upload
return nil, ErrReadOnlyReplica
}
diff --git a/internal/lease/snapshotpipe.go b/internal/lease/snapshotpipe.go
index 59b02b6b7..2c51267d2 100644
--- a/internal/lease/snapshotpipe.go
+++ b/internal/lease/snapshotpipe.go
@@ -29,8 +29,24 @@ import (
type pipeClosingClient struct{ litestream.ReplicaClient }
func (c pipeClosingClient) WriteLTXFile(ctx context.Context, level int, minTXID, maxTXID ltx.TXID, r io.Reader) (*ltx.FileInfo, error) {
- if pipe, ok := r.(*io.PipeReader); ok {
- defer pipe.Close()
- }
+ defer closePipeBody(r)
return c.ReplicaClient.WriteLTXFile(ctx, level, minTXID, maxTXID, r)
}
+
+// pipeBody is an upload body backed by a pipe: litestream's *io.PipeReader
+// and, since litestream 0.5.18, its snapshot reader, which embeds one and
+// also lifts its hold on checkpoints when closed. An *os.File or a byte
+// reader is not one, so closePipeBody never closes a caller's file.
+type pipeBody interface {
+ io.ReadCloser
+ CloseWithError(error) error
+}
+
+// closePipeBody closes r if it is a pipe body, so a refused or failed
+// upload never leaves litestream's encoder blocked holding the WAL
+// (#811, #1193).
+func closePipeBody(r io.Reader) {
+ if p, ok := r.(pipeBody); ok {
+ _ = p.Close()
+ }
+}
diff --git a/internal/lease/teardown_linux_test.go b/internal/lease/teardown_linux_test.go
index 1a92dea40..409737f03 100644
--- a/internal/lease/teardown_linux_test.go
+++ b/internal/lease/teardown_linux_test.go
@@ -11,6 +11,7 @@ import (
"path/filepath"
"runtime"
"slices"
+ "strings"
"testing"
"time"
@@ -150,10 +151,17 @@ func (c *cancelAfterHeader) Read(p []byte) (int, error) {
// snapshot, an encoder that never writes, a pipe nobody closes) meets it.
const snapshotGuard = 30 * time.Second
+// snapshotPipe is litestream's snapshot reader: an *io.PipeReader, or
+// since litestream 0.5.18 a reader that embeds one.
+type snapshotPipe interface {
+ io.ReadCloser
+ CloseWithError(error) error
+}
+
// cancelledUpload is what cancelledSnapshot saw of one snapshot upload.
type cancelledUpload struct {
- pipe *io.PipeReader // the snapshot's own reader, litestream's pipe
- err error // the upload's answer
+ pipe snapshotPipe // the snapshot's own reader, litestream's pipe
+ err error // the upload's answer
// blocked is nil once the encoder was seen offering a body write to
// the pipe after the upload returned: blocked on a pipe that nothing
// will read again.
@@ -173,7 +181,7 @@ func (c cancelledSnapshot) WriteLTXFile(ctx context.Context, level int, minTXID,
return c.ReplicaClient.WriteLTXFile(ctx, level, minTXID, maxTXID, r)
}
up := cancelledUpload{}
- up.pipe, _ = r.(*io.PipeReader)
+ up.pipe, _ = r.(snapshotPipe)
ctx, cancel := context.WithCancel(ctx)
defer cancel()
info, err := c.ReplicaClient.WriteLTXFile(ctx, level, minTXID, maxTXID, &cancelAfterHeader{r: r, cancel: cancel})
@@ -193,7 +201,7 @@ func (c cancelledSnapshot) WriteLTXFile(ctx context.Context, level int, minTXID,
// write, and consumes none of it: a zero-length Read returns once a
// writer is waiting in Write, which then goes on waiting. nil means the
// writer is blocked in a write; an error that the pipe was closed first.
-func offering(pipe *io.PipeReader) error {
+func offering(pipe snapshotPipe) error {
got := make(chan error, 1)
go func() {
_, err := pipe.Read(nil)
@@ -214,7 +222,7 @@ func offering(pipe *io.PipeReader) error {
// been closed (io.ErrClosedPipe), without draining it. Its writer is
// blocked offering a write (offering), so each zero-length Read returns
// at once until then.
-func readerClosed(pipe *io.PipeReader) error {
+func readerClosed(pipe snapshotPipe) error {
for guard := time.Now().Add(snapshotGuard); ; runtime.Gosched() {
_, err := pipe.Read(nil)
switch {
@@ -265,13 +273,20 @@ func TestTeardownReleasesACancelledSnapshot(t *testing.T) {
case <-time.After(snapshotGuard):
t.Fatal("the store's snapshot monitor made no snapshot")
}
- if !errors.Is(up.err, context.Canceled) || up.blocked != nil {
- t.Fatalf("the snapshot upload = %v, its encoder: %v; want it cancelled, the encoder blocked on its pipe", up.err, up.blocked)
+ if !errors.Is(up.err, context.Canceled) || up.pipe == nil {
+ t.Fatalf("the snapshot upload = %v (reader %T); want it cancelled, on litestream's snapshot pipe", up.err, up.pipe)
}
// Before any teardown: the store's replica client, not a closed
- // database or a cancelled store, is what releases the encoder.
- if err := readerClosed(up.pipe); err != nil {
- t.Fatal(err)
+ // database or a cancelled store, is what releases an encoder left
+ // blocked on its pipe. From litestream 0.5.18 the encoder may instead
+ // have ended on its own before it blocked; either way nothing is left
+ // holding the WAL, which tornDownFiles checks below.
+ if up.blocked == nil {
+ if err := readerClosed(up.pipe); err != nil {
+ t.Fatal(err)
+ }
+ } else if !strings.Contains(up.blocked.Error(), "the pipe closed before its encoder blocked") {
+ t.Fatalf("the snapshot's encoder: %v", up.blocked)
}
r.Abandon(ctx)
tornDownFiles(t, dbPath)
diff --git a/internal/provision/testdata/plan14-root-reads-chain.tsv b/internal/provision/testdata/plan14-root-reads-chain.tsv
index 65425d015..77897f996 100644
--- a/internal/provision/testdata/plan14-root-reads-chain.tsv
+++ b/internal/provision/testdata/plan14-root-reads-chain.tsv
@@ -297,3 +297,4 @@ plan14-root-reads-store-write-credential.tsv 8b8e269938a575bfaeb8f0c9a5be508b4b2
plan14-root-reads-rootfs-netlink-route-1419.tsv 0d02e63b6a67aab196e13324393148ab8faccbd4331af3eadb1ab52ff5b42bb1
plan14-root-reads-cert-import-1429.tsv f8456c51c3a939da8642127aa5daffe5c892ade4e35dc6845d6bcd2c2aa19742
plan14-root-reads-store-write-credential-phase2-fixes.tsv ce6e123ac6a66f77f39ca4047576789f31868b5422c6a9a67231e82c71a14764
+plan14-root-reads-litestream-0518-1443.tsv ce6e123ac6a66f77f39ca4047576789f31868b5422c6a9a67231e82c71a14764
diff --git a/internal/provision/testdata/plan14-root-reads-litestream-0518-1443.tsv b/internal/provision/testdata/plan14-root-reads-litestream-0518-1443.tsv
new file mode 100644
index 000000000..899c5041b
--- /dev/null
+++ b/internal/provision/testdata/plan14-root-reads-litestream-0518-1443.tsv
@@ -0,0 +1,5 @@
+# Census overlay litestream-0518-1443, written by census-propose (#369). census-ruling-litestream-0518-1443, approved on #280 before the merge; the approval card is docs/superpowers/notes/census-proposal-litestream-0518-1443.md.
+# 0 body, 0 sites, 3 envelope: each changed unit re-frozen at its existing disposition with its claim appended.
+@coverage . 30fa67324e54dc81cd07bdd8e8b4c14e08291e0269ae7613b18d4b77076e571a
+@coverage internal/dbdoor 17e8022c8697393179aa01ccf4594d667ec93368cebd7156cc84caea79b2d394
+@coverage internal/lease e116672037e0d660a977c4a22c6eac9c63c4501909c22964e300e38f402fade1