Release, recovery and deferral of outbox batches still cost a write per row

オープン
#3,410 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
csharp

調査の方向性

Start by reading OutboxDrainer.ReleaseAsync and the claim logic it uses for leased rows; then trace how each lane reads PluginState and builds the deferred-id exclusion list. Check the existing outbox tests before changing behavior. Done means each proposal item is fixed or explicitly declined in the PR, with tests covering every fix.

索引モデルが issue の本文から書いたものです。

説明

area:events performance

Problem

These are left over from the review of PR #3404 (outbox lanes per owner). None of them loses an event; they cost writes, time or log noise.

  1. Release on shutdown, row by row and without a token. A stopping host releases each unclaimed row of a batch with its own conditional UPDATE (OutboxDrainer.ReleaseAsync), and the update takes no cancellation token. A large batch can therefore hold shutdown for BatchSize writes.
  2. Recovery after a failed release is row by row. A release that fails leaves the row leased with its claim attempt counted. Once the lease lapses, the row is claimed alone because it still names an owner. A whole failed batch is then recovered one claim per row.
  3. Deferrals cost a write each while plugin state is down. When PluginState cannot be read, every row of a batch is released and deferred with one write each. Each later drain then repeats the read of the plugin state for every lane.
  4. Deferrals are bounded by time only. A deferred row is skipped for MissingHandlerDelay, and the set of deferred ids is not capped. Their ids also go into every claim as a NOT IN parameter list. A long thread-pool starvation can make that list long.

Proposal

  1. Release the rest of a batch with one UPDATE ... WHERE id IN (...), bounded by a short timeout.
  2. After a lapsed lease, claim alone only the first row that names a dead owner, not each of them.
  3. Read plugin state once per lane pass, and on failure release the batch in one write.
  4. Cap the deferred set, for example at BatchSize, and leave the oldest out of the NOT IN list.

Acceptance

  • Each item fixed or explicitly declined in its PR, with tests for those fixed
主要言語
C#
スター
567
フォーク
107
平均マージ
1時間 19分
マージ済み PR(30日)
353

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fluentcms/FluentCMS のほかの issue

fluentcms/FluentCMS の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。