chore(worker): set `placement.region = aws:us-east-1`; add the 5-round-trip budget counter to the contract suite
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- postgresql, rust
- Lĩnh vực
- backend, databases, performance, testing
Hướng nghiên cứu
Read crates/thrust-worker/wrangler.toml and wrangler.stage2.toml, then inspect the Pg wrapper in crates/thrust-adapters-postgres/src/lib.rs and the contract suite described in docs/src/architecture/app.md. Check the existing benchmark entry point in crates/thrust-contract-tests/src/bin/bench.rs and coordinate its deployed runs with issue #37, which recreates the deleted Stage 2 resources. Done means both configs pass dry-run, the Postgres contract test enforces the five round-trip limit and kills its mutant, memory targets are explicitly excluded, placement is verified, and benchmark results are recorded.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Context
Neither crates/thrust-worker/wrangler.toml nor wrangler.stage2.toml has a [placement] section. The database is in us-east-1: ADR-0094:39, and the thrust-pg instances run on us-east-1a and us-east-1b nodes (research/0010:316). The Stage 2 numbers were taken from one laptop in the US east: list p95 86 ms, create p95 296 ms at c=1 and 559 ms at c=8, and 595 to 615 ms for the first database request on a fresh isolate (research/0004:383-387). Every statement goes through the Pg wrapper as one round trip (crates/thrust-adapters-postgres/src/lib.rs:106-127); today a list costs two (membership at lines 187-191, the list at lines 229-230). The contract suite is a black-box HTTP suite (docs/src/architecture/app.md:68), and bench takes iterations and concurrency (crates/thrust-contract-tests/src/bin/bench.rs:2).
Problem
The p95 < 500 ms target (SPEC.md:78) is set by three things the plan does not budget: placement, query count and the cold path.
- Placement: Cloudflare puts each sequential query at 20 to 30 ms from a distant region and 1 to 3 ms when the Worker is placed nearby (hyperdrive/concepts/how-hyperdrive-works), and placement hints accept
placement.region = "aws:us-east-1"(workers/configuration/placement). - Query count: Plane's project page fires 13 reads and its workspace wrapper fires 9 (
research/0003:47-48). Without a budget, the compat layer will reproduce Django's N+1 query shapes. - Measurement: where p95 is measured is still open (Q-G5.2,
QUESTIONS.md:299;SPEC.md:83).
Proposal
Covers FR-08 items (1) to (3). The plan side is the ADR-0040 (S3, S5) and ADR-0094 round-29 notes and the SPEC §6.4 text.
- Add to both wrangler files:
[placement] region = "aws:us-east-1" - Budget list endpoints at no more than 5 database round trips per request. The Postgres adapter counts every statement issued through
Pgduring one request (the review's "countingConnector") and reports the count only whenTHRUST_TEST_ROUTESis on, for example in anx-thrust-db-round-tripsresponse header. A contract test asserts the count on the Postgres targets. - Re-run
benchat c=1 and c=8 against the deployed Worker with placement set, from the same vantage point asresearch/0004§10.3. The Stage 2 resources were deleted (wrangler.stage2.toml:3), so run this together with the spike 0002 runs in #37, which recreate them and also add the distant-region bench. - Context for Q-G5.2, which the plan edits answer: "p95 of a synthetic probe from the origin's region on the warm path, 5-minute cadence, cold starts reported separately; availability over a rolling 30 days on the same probe". FR-08 (4), the allocation order, is measured in #37.
Acceptance criteria
-
grep -n 'region = "aws:us-east-1"' crates/thrust-worker/wrangler*.tomlmatches both files, andwrangler deploy --dry-runaccepts the config. - The Workers API reports the deployed Worker's placement (workers/configuration/placement, "Check placement status").
- Contract test
list_endpoints_stay_within_five_db_round_tripspasses onnative-pgandworker-cf, and it fails against a mutant that issues one extra statement per returned row. Add the mutant toscripts/mutants.sh, where it must be reported KILLED. - On the memory targets, which count nothing, the test is excluded explicitly and the expected pass count is adjusted, so it cannot pass vacuously.
- The c=1 and c=8 results with placement on are recorded next to the
research/0004§10.3 table.
References
- Review: .agents/plans/contrail/reviews/2026-10-19-fable-architecture-review.md (FR-08)
crates/thrust-worker/wrangler.toml;crates/thrust-worker/wrangler.stage2.toml;crates/thrust-adapters-postgres/src/lib.rs:106-127,187-191,229-230;crates/thrust-contract-tests/src/bin/bench.rs- SPEC §6.4 (
SPEC.md:78,83); Q-G5.2 (QUESTIONS.md:299); ADR-0040 S3 and S5 (adrs/data/base/0040-system-of-record-database.md:82,84); ADR-0043; ADR-0094:39 research/0004§10.3 (research/0004-rust-on-workers-binding-matrix.md:383-387);research/0003-compat-plane-inventory.md:47-48; spike 0002 step 7- Cloudflare docs: workers/configuration/placement; hyperdrive/concepts/how-hyperdrive-works
Finding: FR-08
- Ngôn ngữ chính
- Rust
- Star
- 0
- Fork
- 0
- Merge trung bình
- 1 giờ 35 phút
- Pull request đã merge (30 ngày)
- 67
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của aRustyDev/thrust
-
area:process prio:p1 type:security
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process bug prio:p1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 38/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process prio:p1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process prio:p1
Độ khó 4/5 1-2 ngày Mức phù hợp với người mới 55/100
Maintainer thường phản hồi trong vòng 1 ngày
-
area:process prio:p1
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 56/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của aRustyDev/thrust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Clean master build fails in zune-jpeg error conversion and zero-IV array construction (patch)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
CakeRepository/agentshangout#995 ·
-
area:frontend kind:bug priority:p3 ready
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày