pref: 日志模块支持按项目聚合统计和熔断 #13379 - #13381
Open
royalhuang wants to merge 6 commits into
Open
Conversation
上报 API/事件增加可空 projectId,未携带时回退 b:buildId;解析走本地/Redis/新表 T_LOG_BUILD_PROJECT,不依赖 process,保证与 worker 任意发布顺序兼容。 Co-authored-by: Cursor <cursoragent@cursor.com>
royalhuang
requested review from
carlyin0801,
irwinsun,
mingshewhe,
randychen2046,
stubenhuang,
tangruotian and
zanyzhao
as code owners
July 29, 2026 03:27
积压时构建结束事件先于日志被消费,flushLineNum2DB 随即删除行号缓存, 后续日志只能回退 db 基线重新分配行号,与已写入日志撞上同一个确定性 _id, 在 ES 中直接覆盖历史日志。 - flushLineNum2DB 不再删除行号缓存,改为缩短 TTL 留出消费宽限期 - updateLastLineNum 加只增不减条件,避免重复/乱序结束事件把高水位改小 - saveIndex 改用 setIfAbsent,建索引晚于首批行号分配时不再重置 - 行号缓存丢失时用本 Pod 已分配水位续上,确认回退后放弃确定性 _id - 新增 log_line_num_watermark_lost_total / log_line_num_flush_missed_total 顺带修复 projectId 聚合改动引入的两处隐患: - LogProjectIdResolver 的 negative 缓存改为有界 Caffeine,原 Map 无法回收 - LogStorageDegradeSwitcher 淘汰逻辑加节流,避免热路径反复全量排序 Co-authored-by: Cursor <cursoragent@cursor.com>
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.
#13379 支持上报项目ID和聚合