docs(media): load balancers may retry upload pieces on another instance

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-10-19 00:07:03 +02:00
parent 6ee9ccc18a
commit 441f26f814

View File

@@ -177,6 +177,12 @@ off and the rest of the server runs.
and any instance may take the next one. Every part's payload is hashed into its and any instance may take the next one. Every part's payload is hashed into its
signature, so a part damaged in transit is refused. A file sent in one `PUT` goes up signature, so a part damaged in transit is refused. A file sent in one `PUT` goes up
part by part as it arrives, with at most three 16 MiB parts in memory. part by part as it arrives, with at most three 16 MiB parts in memory.
- **Behind a load balancer**, let a request that cannot reach one instance go to the
next. Upload pieces are idempotent (a piece sent twice is a no-op), so this is safe
even for their POST/PATCH, which nginx does not retry by default:
`location ~ ^/v1/media/[0-9a-f]+/upload$ { proxy_next_upstream error timeout non_idempotent; … }`.
Without it the client still retries, but a balancer that keeps sending its
retries to a dead instance makes the run stop; running it again resumes.
- **Racing uploads of one id** (on any instances) each go to their own object key; - **Racing uploads of one id** (on any instances) each go to their own object key;
the primary key in Postgres admits one record, and the loser deletes its object. the primary key in Postgres admits one record, and the loser deletes its object.
Delete removes the record first, so a crash never brings a film back. Delete removes the record first, so a crash never brings a film back.