Outbox prune and purge by handler read every failed row that the failed index cannot filter

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

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

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

評価

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

調査の方向性

Read the ix_cms_outbox_failed definition from PR #3406 and inspect OutboxPruneJob and OutboxDeadLetters to confirm the prune and purge queries. Measure both query plans with a large failed set; then either document the measured cost or propose an index change and obtain the required model slot. The issue gives no test or benchmark file, so first locate the query and database model tests.

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

説明

area:events performance

Problem

ix_cms_outbox_failed (PR #3406) is on cms_outbox (sequence DESC, id) filtered to status = 'failed'. It serves the dead-letter list exactly. Two other readers of failed rows also walk it, but filter on columns it does not hold, so they read every failed row to find the few they want:

  • the prune of failed rows (OutboxPruneJob): available_at < before AND attempts >= MaxAttempts;
  • the purge of a handler's dead letters (OutboxDeadLetters, purge by handler): handler = ?.

With the 30-day retention the failed set stays bounded, but a burst of failures (a receiver down for days) makes each hourly prune batch, and each purge, read that whole set.

Proposal

Measure it with a realistic failed set first. If it matters, add the filtered columns to the index as included columns (PostgreSQL, SQL Server) or as trailing keys (SQLite). Or add a second filtered index on (handler, available_at). That is a model change, so it needs the model slot.

Acceptance

  • The prune and purge-by-handler plans are checked with a large failed set, and either fixed or the cost is documented
主要言語
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 を短くまとめたダイジェスト。