fix(worker): hello 首连同步分块,不再单次序列化上万行(保完整性)(#129)#306
Merged
Conversation
hello 补拉曾无 LIMIT,since=0 单次把最多 1 万行一并 toArray 序列化(REST 早有 limit=1000)。 改为按 seq 游标分页(每页 ≤ HELLO_BACKFILL_PAGE_SIZE=1000),循环到某页短于一页即排空, 跨批次逐帧下发全部消息——客户端消费与不分页完全一致,首连即完整的契约不破。 分页游标从 0 起(非 since):since_rev 命中的行 seq 可能 ≤ since,必须纳入遍历。 补拉期不 await(DO 单线程、快照一致),边界只漏 hello 开始后的新消息、由 live 广播补上。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修什么(#129,[P3][impl])
hello 首连补拉曾无 LIMIT:
since=0单条查询把最多 1 万行一并toArray序列化(REST/internal/messages早有limit=1000)。首连同步语义被依赖,正确修法是分块而非砍 LIMIT。怎么修(分页,保完整性)
HELLO_BACKFILL_PAGE_SIZE=1000):WHERE (原条件) AND seq > ? ORDER BY seq LIMIT ?,循环到某页短于一页即排空,游标推进到本页末 seq。seq 唯一升序 → 严格前进、不重不漏。跨批次逐帧下发全部消息,客户端消费与不分页完全一致,首连即完整的契约不破。since_rev命中的修订行 seq 可能 ≤ since,必须纳入遍历,否则漏「seq 小但被修订」的行。门禁(对 origin HEAD rebase 后亲验)
__maxBackfillBatch ≤ 1000(有界性)。🤖 opus agent 实现、收尾截断我接管(审+提交+复验)。