Export walk: re-decodes per page, skips no segments, and is unbenchmarked
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 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分
- マージ済み PR(30日)
- 367
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
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 件 ·