-
Notifications
You must be signed in to change notification settings - Fork 3.7k
branch-3.0: [fix](cloud) fix file cache potential leakage #46561 #47376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
将原来的 同步/异步删除 cache meta + 同步/异步删除 cache data file 多维度的删除策略降维简化: 所有 cache meta 都是同步删除(除正在使用,此case处理方式见下文),data file在 critical 场景同步删除、gc 场景下异步删除 异步清理调度的优化: - 之前的调度逻辑会提前中断,导致清理效率低下 - 甚至调度会有概率进入某些状态导致清理无法继续进行 - 优化 CPU 使用,避免额外无效队列遍历 - 增加窗口算法对异步删除 data file 进行 qps 限制 优化标记删除: - 之前的标记删除机制对 TTL data file 有两个方面的空间泄漏问题 - 扩展应用场景:从原来只能用于 clear_cache、reset_capacity缩容,扩展任意异步删除的场景 - 将新的标记删除机制 除应用在 正在引用的数据之外,还解决了 DOWNLOADING 状态数据的删除泄漏问题 fix 删除正在引用的数据过程的多处泄漏: - 之前没有机制对于正在引用的数据进行标记删除,只能放任赦免 - 现在配合优化后的标记删除机制,使用析构函数在释放引用后自动删除 发现并修复队列操作中存在的内存写飞隐患 - reset_capacity 在迭代内部 erase容器条目,可能会导致指针悬空 其它小优化: - 使用 concurrentqueue 代替之前的静态无锁队列:保持性能的同时减少队列满、进入同步删文件带来的 IO burst 及伴随的 cache lock 开销 - 清理弃用的 file_cache_ttl_valid_check_interval_second 配置:现在 ttl 支持 LRU 了,不用额外定时清理 - 多线程拆分:避免 metrics、resource limit、data file 清理、ttl 超时清理 相互影响 Signed-off-by: zhengyu <zhangzhengyu@selectdb.com>
Contributor
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
Contributor
|
run buildall |
TPC-H: Total hot run time: 41488 ms |
TPC-DS: Total hot run time: 191915 ms |
ClickBench: Total hot run time: 32.04 s |
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.
Cherry-picked from #46561