Let backends declare thread_safe and allow concurrent backend calls in Store (follow-up to #206)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 35/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 冷清
- 技术栈
- python
调研方向
首先阅读 BackendBase 和 Store 的实现,重点关注 _stats、writethrough-cache 计账、_cache_disabled 以及后端的 load/store/delete 调用。比较此处描述的主后端和缓存后端要求。当线程安全声明和经过审查的设计能够保护 Store 的记账,同时允许安全地并发调用后端时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Follow-up to #206 / #207 (from Claude, reviewed by TW).
#207 serializes all Store operations with one internal lock. That is correct and sufficient for today's callers (borg's #9988 pack store-thread issues one op at a time), but it means the store can never execute two backend calls concurrently - even on backends where that would be safe and beneficial.
Idea
Let a backend declare itself safe for concurrent calls, and let Store exploit that:
- Declaration:
BackendBase.thread_safe: bool = Falseclass attribute. posixfs can honestly setTrue(independent syscalls per call). sftp/rest/rclone/s3 stayFalsewith their single session - or later becomeTruevia a connection pool. - Store side: this is not just "skip the lock" - the Store's own bookkeeping (
_statsCounter updates, writethrough-cache accounting,_cache_disabled) needs protection regardless of the backend. The finer-grained design: keep a small lock for stats/cache mutations, but allow the backend calls themselves (backend.load/store/delete/...) to run outside the lock whenbackend.thread_safeis true. - Cache backend: the cache backend is a second, independent backend with its own
thread_safe- concurrent primary + cache calls need both declarations (or per-backend locks).
Why bother (later)
- multiple concurrent uploads to hide per-request latency on cloud backends (the "riskier follow-up" scoped out of borgbackup/borg#9988),
- parallel prefetch on extract,
- concurrent range-reads for
get_manyon packs living in different objects.
None of these exist as callers today, which is why #207 deliberately kept the simple unconditional lock. This issue exists so the design above does not get lost, and to be picked up once a real parallel-I/O caller shows up.
- 主要语言
- Python
- 星标
- 26
- 派生
- 9
- 平均合并
- 2 小时 22 分钟
- 30 天内合并 PR
- 12
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
borgbackup/borgstore 的其他 Issue
-
难度 5/5 一周以上 新手友好度 35/100
borgbackup/borgstore#234 ·
维护者通常 1 天内回复
-
难度 4/5 3-5 天 新手友好度 35/100
borgbackup/borgstore#201 · 1 条评论 ·
维护者通常 1 天内回复
-
stats: cache_disabled is False even when no cache backend is configured可能已有人在做 @MuhammadBilal64 于 9 天前认领。 未关闭
难度 4/5 3-5 天 新手友好度 48/100
borgbackup/borgstore#199 · 1 条评论 ·
维护者通常 1 天内回复
-
write-back cache未关闭enhancement
难度 5/5 一周以上 新手友好度 30/100
borgbackup/borgstore#169 ·
维护者通常 1 天内回复
-
enhancement
难度 5/5 一周以上 新手友好度 35/100
borgbackup/borgstore#165 ·
维护者通常 1 天内回复
查看 borgbackup/borgstore 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 68/100
jbacalso24/mimry#291 ·
维护者通常 1 天内回复
-
good first issue
难度 2/5 1 小时以内 新手友好度 82/100
eli-alvarado/us-watchlist-alerts#14 ·
维护者通常 1 天内回复
-
from-review-extraction python severity:nit
难度 2/5 1-3 小时 新手友好度 80/100
LearningCircuit/local-deep-research#7462 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
cathrynlavery/diagram-design#441 ·
维护者通常 2 天内回复
-
[Cleanup] Include the public header in work_split.cpp可能已有人在做 @blozano-tt 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
tenstorrent/tt-metal#60850 ·
维护者通常 1 天内回复