🤖 report: ddm: exchange handlers write the DB after the session stops
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
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- rust
- Lĩnh vực
- databases, distributed-systems, networking
Hướng nghiên cứu
Start with ddm/src/sm/state.rs around expire_peer and ddm/src/exchange/runtime.rs around push_handler_common and pull; trace how session updates reach the DB and sibling peers. The agreed design is for the session FSM to be the only writer, with updates carrying a connection ID and stale-session updates discarded. Done means addressing the four reported races while keeping handlers nonblocking; the issue names no tests to run.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
expire_peer stops the pull thread and calls exchange_thread.abort() (state.rs L341-L448). abort() stops only the task that waits on the dropshot server. A Push handler that started before continues: dropshot runs handlers as detached tasks, and push_handler_common uses spawn_blocking (runtime.rs L359-L374). The handler writes the DB. The FSM sends the change later, with PeerEvent::Redistribute. The FSM can stop between these two steps.
Form 1: Redistribute is discarded at teardown. Observed in CI on PR #971 (sextet job 01M62FK8S9AKR2D6WGFWA7KDB7, head a93ce763).
sequenceDiagram
autonumber
participant t2 as t2 (peer)
participant H as t1 push handler
participant Q as t1 FSM
participant DB as t1 DB
participant s1 as s1 (sibling peer)
Note over s1: s1 has R(old)
t2->>H: announce R(new), withdraw R(old)
Note over Q: Shutdown arrives.<br/>Queue: Shutdown
H->>DB: write R(new), delete R(old)
H->>Q: Redistribute (queued after Shutdown)
Note over Q: expire_peer reads DB: R(new)
Q->>s1: withdraw R(new)
Note over Q: FSM stops.<br/>Redistribute is discarded.
Note over s1: withdraw R(new) matches nothing.<br/>s1 keeps R(old).
Form 2: Late write. A handler writes after expire_peer removed the routes. The DB and forwarding entries stay for a dead nexthop. Nothing removes them.
Form 3: Old event in a new session. pull() checks stop before handle_update (runtime.rs L164-L170), and old handlers continue after abort(). After a fast flap, the new session can send a change from the old session. Siblings then get routes that are not in our RIB or FIB.
Form 4: Two writers in one session.
sequenceDiagram
autonumber
participant P as Peer
participant PT as Pull thread
participant H as Push handler
participant DB as DB
PT->>P: GET /v3/pull
P-->>PT: reply has X
P->>H: Push: withdraw X
H->>DB: delete X
PT->>DB: add X (old reply)
Note over DB: X is back. The peer withdrew X.
Correction (agreed design): Make the session FSM the only writer.
sequenceDiagram
autonumber
participant H as Push handler
participant PT as Pull thread
participant F as Session FSM
participant DB as DB
participant S as Siblings
H-)F: Apply(conn id, update)
Note over H: Return 204 at once. Do not wait.
PT-)F: Apply(conn id, update)
Note over F: Is conn id current? If not, discard.
F->>DB: write
F->>S: Push
Note over H,S: One writer per session. Write and send occur in one step.
- The handler must not wait for the FSM. If it waits, two routers that push to each other can deadlock.
- A smaller fix for forms 1 and 2:
HttpServer::close().await, and then send the queued Redistributes. This can stop behind a handler that does not end.
All four forms are on main. Forms 2–4 come from code review.
- Ngôn ngữ chính
- Rust
- Star
- 100
- Fork
- 8
- Merge trung bình
- 2 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 18
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
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 oxidecomputer/maghemite
-
ICMPv6 Router Solicitations are generated with invalid checksumsCó thể đã có người làm @taspelund đã nhận 154 ngày trước. Đang mởBug mgd ndp rust
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
oxidecomputer/maghemite#802 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ddm
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
oxidecomputer/maghemite#1039 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
ddm want
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
oxidecomputer/maghemite#1033 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Bug ddm rust
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 78/100
oxidecomputer/maghemite#997 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
🤖 ddm: a withdraw removes a route that a second source still givesCó thể đã có người làm @taspelund đã nhận 19 ngày trước. Đang mởBug ddm rust
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
oxidecomputer/maghemite#996 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của oxidecomputer/maghemite
Issue tương tự
-
[Bug]: Add Data's question says "Link to the file" for a GeoPackage where small tables are copiedĐang mởunconfirmed possible issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 64/100
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
jerney-nexus/epikrise#364 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Yeachan-Heo/gajae-code#8058 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug daemon
Độ 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
-
good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày