Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Ordered loader can drop the debt of an invalidation that arrives while a finished repair releases its leases

未关闭
#2,222 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
backend

调研方向

Start with finishOrderedPrefixRepair() in packages/db/src/query/live/ordered-source-loader.ts and the request-authority oracle in packages/db/tests/query/ordered-source-loader-state-oracle.test.ts. Add a release callback that calls invalidateSourceOrdering() during retirement, then run the oracle test and check its progress law. Done means the regression fails before the fix and the next repair pass issues a read afterward.

由索引模型根据 Issue 内容生成。

描述

Summary

A review of #2194 reported a possible defect in OrderedSourceLoader.finishOrderedPrefixRepair() (packages/db/src/query/live/ordered-source-loader.ts). No test reproduces it yet.

When a bounded repair finishes, the loader releases the leases that the repair superseded. Then it moves the work slot to idle with debt none. A release can run adapter code. That code can deliver an ordering invalidation, for example a loadedSubsets:invalidated report or an order-changing update. Then invalidateSourceOrdering() moves the ordering epoch while the repair still owns the work slot. The debt is already bounded, so it stays bounded. The final move then sets the debt to none.

Expected

An ordering invalidation that arrives during the release pass gets a bounded repair (ARCHITECTURE.md, "Ordered requests, continuation, and recovery").

Possible result

The loader drops the debt of the newer invalidation. The window can keep wrong rows until some other change invalidates the ordering.

Next step

Before a change, add a witness that fails. The request-authority oracle in packages/db/tests/query/ordered-source-loader-state-oracle.test.ts has release callbacks that reenter the loader. A release callback that calls invalidateSourceOrdering() during the repair's retirement pass reaches this history. Its progress law requires the next pass to issue a read.

A possible change: before the final move, compare the chain's epoch with the current ordering epoch, and keep the debt if the epoch moved.

This issue was written by Isaac.

主要语言
TypeScript
星标
3.9k
派生
277
平均合并
18 小时 7 分钟
30 天内合并 PR
228

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

TanStack/db 的其他 Issue

查看 TanStack/db 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。