Repository navigation
refactor(storage): move temporary spill files to Rust - #2790
Merged
Merged
Conversation
footka
marked this pull request as ready for review
December 1, 2026 09:59
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5530ecc8e7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
hnwyllmm
approved these changes
Dec 1, 2026
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.
任务描述
把 SQL 外排和索引构建使用的临时文件迁到 Rust。临时段存入实例独立的
data_dir/spill,删除后空间可直接回到文件系统。磁盘占用问题见 #2192。
5e475af43和 Rust75d1cdea4源码构建,每种规模各一对。56 万条建索引期间的库目录实际峰值从 4.82 GiB 降至 3.31 GiB,计入建完后 60 秒的全程峰值为 4.82 → 3.79 GiB。停机后库目录从 4.81 GiB 降至 3.79 GiB(−21%),其中block_file从 4.00 GiB 降至 3.00 GiB。Rust 独立临时段峰值为 1.22 GiB,建索引 SQL 返回时已归零。5.6 万条的停机后占用从 658 MiB 降至 399 MiB。客户原始数据待复测。解决方案
Rust 统一管理临时段的读写、配额和回收,SQL 调用方沿用 data-plane 接口。
宽行按有界写缓冲分段写入。当异步预取拿不到读缓冲时,直接把数据读进调用方已有的缓冲。封存使用查询当时剩余的时间。
验证
75d1cdea4。17 项 Rust 测试、3 项仓内 mysqltest 通过。三个 45 MiB 排序键的用例在修复前报 4013,修复后和 C++ 基线返回一致。seekdb_test的临时文件配额建索引通过。现有用例已断言超配额返回 9135、放宽后可建索引,无需改动。dd6ab4fd1,未发现可复现的新增 SQL 回归。本次修复在 Linux 验证。影响范围
SQL 外排、索引构建及临时文件的空间配额和监控。
合入理由
临时数据有独立的回收路径,并缩小了维护范围。已有微基准的模块耗时仍高于 C++,模块性能差距尚未达到 10% 目标。