Ordered loader: recover failed ordered requests with a bounded repair instead of a full-source read
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 8/100
- issue の種類
- リファクタリング
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
調査の方向性
The work centers on OrderedSourceLoader's fail, failRequest, finishOrderedPrefixRepair, abandonOrderedPrefixRepair, scheduleRepairRetry and the retry gate in loadMore. Before editing, read the ordered-source-loader, loader-state and pagination oracle tests, and the 'Ordered requests, continuation, and recovery' section of packages/db/src/query/live/ARCHITECTURE.md. Done means the bounded failure-recovery law is stated in those oracles and the pinned expectations, including the failing pagination-oracle tie-boundary and reject/abort lease cases, pass.
索引モデルが issue の本文から書いたものです。
説明
Problem
When an ordered request fails, the ordered loader recovers by reading the full source. That happens after a failed page, tie, or bounded-repair request, including a synchronous throw or a failed boundary read, and the automatic retries at 250 ms and 500 ms do the same. Full-source reads can be very expensive. Each plan that can continue from a provider prefix (!requiresFullSource) has a cheaper option: a bounded ordered-prefix repair from the start of the order. That repair sets its boundary from its own settled requests, so partial writes from the failed request cannot mislead it.
Rule (maintainer decision): avoid full-source reads whenever a bounded read is available.
PR #2154 applies this rule to an ordering invalidation that overlaps an in-flight page or tie request. It leaves failure recovery unchanged. These paths still read the full source:
- recovery after a failed or canceled request;
- an ordering invalidation that arrives before any request has settled.
What a first attempt showed
A prototype replaced requireFullSourceRepair() with a bounded repair on failure. It also retried the bounded repair in the automatic retries, and let a newer ordering invalidation retry once. Across five test files, 48 pinned expectations then failed. Some of them were real regressions:
pagination-oracle.property.test.ts, "recovers a failed tie boundary …": the window was[1, 4], expected[1, 2].ordered-source-loader-oracle.test.ts, "keeps the 'boundary' acquisition lifecycle exact for reject/abort": after the tie request failed, the original page acquisition was not released.pagination-oracle.property.test.ts, the pending-history campaigns and their captured-history controls: logical settlement did not match the model.
The failure path re-enters the bounded chain in states it was not built for, for example a failed request that overlaps a repair (the abandonOrderedPrefixRepair path).
Work
- In the ordered-source-loader, loader-state and pagination oracles, state the bounded failure-recovery law first:
- recovery shapes;
- the lease release of failed and superseded acquisitions;
- the retry budget;
- retry after a newer invalidation.
- Then change
OrderedSourceLoader:fail,failRequest,finishOrderedPrefixRepair,abandonOrderedPrefixRepair,scheduleRepairRetry, and the retry gate inloadMore. - Update "Ordered requests, continuation, and recovery" in
packages/db/src/query/live/ARCHITECTURE.md.
Related: #2136, #2154. The coverage map backlog entry is "Bounded recovery after a failed ordered request".
- 主要言語
- TypeScript
- スター
- 4k
- フォーク
- 277
- 平均マージ
- 17時間 40分
- マージ済み PR(30日)
- 223
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
TanStack/db のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信
-
Garbage collection cleans up a collection while one of its transactions is still persisting対応中かも @Nabil372 が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
メンテナーはふだん 1 日以内に返信
-
persistedCollectionOptions without a schema can't be passed to createCollection (follow-up to #1452)オープン
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Merit-Systems/x402scan#1312 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Native Web
難易度 1/5 1時間未満 初心者へのやさしさ 80/100
digitalfabrik/integreat-app#4517 ·
メンテナーはふだん 2 日以内に返信
-
TLS guide repeats certs/ in the certificate directory対応中かも @maheshrijal が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
prometheus/docs#3156 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
medusajs/dtc-starter#90 ·
メンテナーはふだん 1 日以内に返信