A shard can fail to send replication heads after an expiry event and a brief not-ready state
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 12/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- elixir
- Lĩnh vực
- distributed-systems
Hướng nghiên cứu
The sequence centres on Group.connect/2, expire_replica_peer, send_replica_heads, and the peer_connect, peer_connect_ack and replica_cluster_open handlers, with route_ready? and epoch deduplication deciding whether heads get resent. Start by reading the TLA+ model the reporter cites next to the readiness check in the code, since their mismatch is the root cause. Done means a repeated peer_connect at the same epoch after a not-ready ack still causes heads to be sent, which needs maintainer agreement on the intended protocol first.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Hello, this is the second issue I identified while experimenting with DST on the Group repo. This one is more involved than #32 , and I was only able to get to about 80% understanding myself. I hope the maintainers find it useful rather than noise.
Description
The summary of the issue is that a shard can fail to send its replication heads after an expiry event and a brief not-ready state. One trigger is a well-timed call to Group.connect/2.
We have a cluster with a, b, and c nodes and multiple shards configured.
Consider this sequence of events:
- A
cshard-0 (c0) is sending heartbeat messages to the corresponding shardb0, but each one remains undelivered. For example, these can be dropped when the dist port is busy as a result of the:nosuspendon the send. b0invokesexpire_replica_peerafter a series of missed heartbeats.b0's belief ofc0data is wiped locally, including the replication cursors forc’s streams and the entry inremote_shards.b0begins rediscovery, which includes newpeer_connectmessages. It bumps its probe epoch forc0toN.c0still holds the same info it had previous. Namely,c0has no pending heads forb, since each was acked until this point.- On
b, we executeGroup.connect(:my_app, "blue"). The revision is bumped toR+1. b0's anti-entropy timer puts the message on theb0mailbox.bputs:cluster_connecton theb0mailbox.b0handles the anti-entropy message, sends apeer_connecttoc0with probe epochN. The revision, read from ets, isR+1.b0handles the:cluster_connect, sendsreplica_cluster_opentoc0, revisionR+1.c0handles thepeer_connectprobe. It has only seen revisionR, soroute_ready?is false.c0records epochNas seen, and acks withpeer_connect_ack(N, false). Because the probe is not ready,c0does not callsend_replica_heads.c0handles thereplica_cluster_open. At this point, a future peer_connect request on a new epoch would be responded to with "ready", and would also resend heads. However, we'll see that apeer_connectwith the same epochNwill not.b0receives the "not-ready" ack and at some future time the process sends anotherpeer_connect, still with epochN.c0receives thepeer_connectat epochN, decides epochNhas already been seen (:duplicate) and acks withpeer_connect_ack(N, true). No heads are sent.b0receives and stops probing. Nothing will ever sendc0’s heads tob0again.
In the TLA+ model, there is a mismatch between what the model describes and what the code implements. The code has an extra readiness check that exposes the bug.
Testing performed on main at 08b5a5.
DST details
Config:
- Injected faults: heartbeats dropped with probability 0.7
- 6 of 600 seeds failed in the sweep. 1 of those 6 is the seqeunce described above. The others appear to have a similar pattern
Code:
- In order to instrument Group for DST with eta, I've had to make changes locally. The changes are focused on allowing Group to run multiple nodes within the same VM. The code is in my fork here.
- Details about the issue were confirmed on unmodified main outside of DST, but not a full runtime reproduction.
- Ngôn ngữ chính
- Elixir
- Star
- 47
- Fork
- 2
- Merge trung bình
- 10 ngày 4 giờ
- Pull request đã merge (30 ngày)
- 1
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 phoenixframework/group
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
phoenixframework/group#32 ·
Tất cả issue của phoenixframework/group
Issue tương tự
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History pageĐang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
wintermeyer/vutuv#2388 ·
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 74/100
-
Broadcast API docs say to prepend realtime: to the topic, which breaks deliveryCó thể đã có người làm @mandar1045 đã nhận 1 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
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 72/100
phoenixframework/phoenix_live_view#4509 ·
Maintainer thường phản hồi trong vòng 1 ngày