A shard can fail to send replication heads after an expiry event and a brief not-ready state
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 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時間
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信