A shard can fail to send replication heads after an expiry event and a brief not-ready state
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 12/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- elixir
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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.
- 主要语言
- Elixir
- 星标
- 47
- 派生
- 2
- 平均合并
- 10 天 4 小时
- 30 天内合并 PR
- 1
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
phoenixframework/group 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 25/100
phoenixframework/group#32 ·
查看 phoenixframework/group 的全部 Issue
相似的 Issue
-
Bug: Table layout and date column are cut off on mobile screens on the Tournaments -> History page未关闭bug
难度 2/5 1-3 小时 新手友好度 74/100
hexlet-codebattle/codebattle#2375 ·
-
Bug
难度 2/5 1-3 小时 新手友好度 68/100
wintermeyer/vutuv#2388 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
Broadcast API docs say to prepend realtime: to the topic, which breaks delivery可能已有人在做 @mandar1045 于 1 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 80/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
phoenixframework/phoenix_live_view#4509 ·
维护者通常 1 天内回复