Repository navigation
s3, wal: endpoint test drains bodies and always aborts once; pacing tests bound a hold, not a runner's speed - #11
Closed
Seif Lotfy (seiflotfy) wants to merge 2 commits into
Closed
Seif Lotfy (seiflotfy) wants to merge 2 commits into
Seif Lotfy (seiflotfy) wants to merge 2 commits into
Conversation
…rpose The fake answered each 8 MiB UploadPart unread and closed the connection under a client still writing it. A starved runner then failed the part (write: broken pipe); when every SDK retry failed, the upload aborted and AbortMultipartUpload joined the resolved operations, failing the exact list. An upload whose body is short of its size now aborts every run, so the list covers AbortMultipartUpload, an operation the backend sends. Co-authored-by: Seif Lotfy <seif@axiom.co> Amp-Thread-ID: https://ampcode.com/threads/T-01a1dba3-f1a0-7360-bec3-57072ae78b08
TestCommitIntervalCoalescesIntoOnePage limited an immediate commit to 100 ms and failed at 166 ms on a starved runner; a commit held an interval takes at least 300 ms, so the limit is now 250. Its rate-limit check timed the third append from after the replay, though the interval runs from the first PUT; it now times from before the first appends, a lower bound on any runner. TestAdoptionDoesNotRearmPacing allowed 750 ms and failed at 786; a re-armed adoption holds the second append to 1,000 ms or more, so the limit is now 950. Co-authored-by: Seif Lotfy <seif@axiom.co> Amp-Thread-ID: https://ampcode.com/threads/T-01a1dba3-f1a0-7360-bec3-57072ae78b08
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Architecture changes: none. Test-only; no production code changes.
1.
TestEndpointCacheMatchesRules(aws/s3)Cause. The fake S3 server answered each 8 MiB UploadPart without reading the request body, then closed the connection while the client was still writing it. On a starved runner the client gets
write: broken pipeand the SDK retries the part. When every attempt fails,multipartcalls AbortMultipartUpload. The test then resolves one more operation than its exact list allows, and fails. The cached endpoint matched the SDK's rules for every operation in every run, Abort included: only the operation list differed. Nothing outside the repository moved. objstore main 398732b passed its s3 job at 14:29 and failed it at 21:01 with the same runner image (ubuntu-26.04 20261111.196.1), the same Go (1.26.0) and the same MinIO digest (sha256:6dabb4a2…). The 21:01 runner was slow: fs took 9.8 s against 5.0 s, and two wall-clock wal tests failed in the same job.Fix. The fake drains every body. One upload, whose body is short of its declared size, aborts on purpose, so AbortMultipartUpload is in the list on every run. It is an operation the backend sends, so the test's "every operation" contract covers it now.
Evidence, under a 25% CPU quota (
systemd-run --scope -p CPUQuota=25%, GOMAXPROCS=4,-race, on a 4-vCPU orb):write: broken pipe, each retried (10 runs)Locally, at both quotas, the old test's race showed up as broken pipes, and the SDK's retries always succeeded. So the test failure itself did not reproduce in the orb: it needs every attempt of one part to fail, which at the measured per-attempt rate is about 1 in 1,000 runs. On CI it failed 3 of 3 s3 jobs from 20:48 (main 398732b attempt 2, store-time ebb3848 attempts 1 and 2), and passed in every test job, which runs it without MinIO's parallel tests. This PR's s3 job, and a rerun of it, are the CI check of the fix.
2. wal pacing tests
TestCommitIntervalCoalescesIntoOnePagefailed in 2 of the last 82 test and s3 jobs (166 ms against a 100 ms limit).TestAdoptionDoesNotRearmPacingfailed once (786 ms against 750), in the same starved job. Both were wall-clock overruns, and the counts were right.interval-50ms). It separates an immediate commit (one 20 ms PUT plus scheduling; 166 ms on the starved runner) from a commit held one 300 ms interval. The count alone is not enough: a held commit also carries both records in one entry. Mutant check: a writer that holds its first idle commit for an interval fails at 324 ms.2*interval-50ms). The retry waits one 500 ms interval and then adopts, so the second append is due about 500 ms after the original PUT. Pacing re-armed at the adoption holds it until 1,000 ms or later. Mutant check: settinglastCommitat adoption fails at 1.007 s.Checks:
gofmt -l .clean,go vet ./...,go test -race -count=1 ./...all pass; 30×-raceof both wal tests pass.