Export walk: re-decodes per page, skips no segments, and is unbenchmarked
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 45/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- go
- 领域
- backend, performance
调研方向
Start with sessionexport.Walk, archive.Earlier, and the exportTimeout comment; then read docs/session-export.md and the referenced discussion in #1830. Benchmark the walk over an archive large enough to expose paging costs, and use that result to guide the ?since segment skip and forward iteration work. Done means the benchmark and measured timeout documentation are updated and the proposed performance improvements are verified.
由索引模型根据 Issue 内容生成。
描述
The walk re-decodes each segment per page, and nothing measures it
sessionexport.Walk reads each session through archive.Earlier(id, 0, ...), which pages
500 events at a time with before = last. Every page re-opens and re-decodes its segment
from the first event, so the cost is roughly quadratic in a session's depth rather than
linear.
Measured by @clawgenti while reviewing #1830:
| Shape | Time |
|---|---|
30k records through Earlier's paging |
2.16s |
the same data in one Page call |
0.20s |
About 10x, on one session.
The ten-second figure in the code is not a measurement
exportTimeout's doc comment used to say the walk "measured ~10s for a 30-day archive".
It did not: the number was extrapolated from a much smaller fixture. #1830 corrects the
comment to say so, but the honest state is that nothing benchmarks the walk at all, so
we do not know what a busy month actually costs. Given the figure above it could be well
above ten seconds.
This matters beyond the comment: agentop export advertises a ten-minute client budget
sized against that estimate, and GET /v1/export is the endpoint a user is told to point
at a month of traffic.
Three things, smallest first
-
Benchmark the walk over a realistic archive — enough sessions and depth that the
paging behaviour shows — and replace the extrapolated figure inexportTimeoutand
docs/session-export.mdwith a measured one. This is the part that unblocks judging
the other two. -
Skip segments below the
?sincefloor. A segment whoseLastWriteprecedes the
floor cannot contain a qualifying event, so it never needs decoding.agentop export --since 24hagainst a 30-day archive currently decodes all thirty days and discards
most of it — the common case, and the cheapest win. -
Read forward per segment, newest segment first, instead of paging backwards through
Earlier. This is the actual fix for the re-decode, and the largest change: it needs
sessionexportto reach segment-level iteration andLastWrite, which today sit behind
archive's read API. Worth doing as its own PR with the benchmark from (1) in place to
prove it.
Why this was not done in #1830
@clawgenti raised it there and labelled it "not blocking for v1", and (3) reshapes an
archive read path mid-review. Filing it so the decision is tracked rather than rediscovered
the first time someone exports a large archive and waits.
Refs #1830, #1810
- 主要语言
- Go
- 星标
- 31
- 派生
- 49
- 平均合并
- 9 小时 43 分钟
- 30 天内合并 PR
- 367
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
rossoctl/cortex 的其他 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug laptop
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 55/100
维护者通常 1 天内回复
相似的 Issue
-
taskmanager: a failed v1alpha1 backup leaves the partial backup behind可能已有人在做 @arshil42 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 80/100
ether/etherpad-go#571 ·
维护者通常 1 天内回复
-
labeler: read a limit above math.MaxInt as math.MaxInt in nonNegative (CodeQL alerts #20 and #21)未关闭cost:approved factory:queued factory:tracking priority:p2 rank:12 ready-for-doing task:approved tokens:50k
难度 2/5 1-3 小时 新手友好度 88/100
sisaku-security/sisakulint#860 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 78/100