-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(alias): support load balance #1767
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
Open
KirCute
wants to merge
36
commits into
OpenListTeam:main
Choose a base branch
from
KirCute:feat/alias-balance
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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
j2rong4cn
reviewed
Dec 9, 2025
KirCute
commented
Dec 11, 2025
|
这个逻辑上有点复杂 能不能完善下文档 如何使用 使用情景案例 和 那个原来的负载均衡驱动不同在哪里 |
Member
Author
最近有点忙,之后会重写alias的文档 |
eb0108a to
05191be
Compare
dc24867 to
14087e5
Compare
Member
|
完事 |
827551e to
4d9e68b
Compare
KirCute
commented
Dec 14, 2025
KirCute
commented
Dec 16, 2025
Member
Author
|
经测试, |
KirCute
commented
Dec 19, 2025
This reverts commit f001f2d.
7 tasks
KirCute
commented
Dec 25, 2025
7 tasks
|
读取冲突策略 选项中没有看到 按分片负载均衡 选项 写入冲突策略 有一个 也没有文档解释 |
Member
Author
没合呢,急什么 |
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.
Description / 描述
较大程度上重构了
alias处理冲突路径的方式,删除了原配置项“保护同名”“可写”和“并行写入”,新增了“冲突路径读取策略”“冲突路径修改策略”和“冲突路径上传策略”三个选项用于替换原功能,其有效值如下:first:修改前alias读取文件的唯一方式,将首个有效路径直接返回。random:随机选择一个有效路径返回。all:302和复制、移动、解压时,降级为random,本地代理时,每个传输分片读取随机一个有效路径的链接。MakeDir、Rename、Remove):disabled:禁止此类操作,原关闭“可写”first:假设用户能够保证路径不冲突,直接对第一个有效路径进行操作,原关闭“保护同名”,不推荐,唯一优点是请求少,比较快deterministic:仅支持对不冲突路径执行此类操作,原打开“保护同名”deterministic_or_all:仅支持对不冲突路径和全冲突路径执行此类操作,原打开“保护同名”和“并行写入”all:对所有冲突路径执行操作,忽略非冲突路径,原打开“并行写入”all_strict:仅支持对全冲突路径执行此类操作Put、PutURL、Copy、Move、ArchiveDecompress):disabled,first,deterministic,deterministic_or_all,all,all_strict:含义与修改策略相同random:随机负载均衡,随机选择一个有效路径用于上传quota:按剩余空间加权负载均衡,上传前获取后端驱动剩余空间,剩余空间越大被选定为上传路径的概率越大,剩余空间不足以上传文件和获取剩余空间失败的冲突路径会被忽略,如果所有成功获取剩余空间的冲突路径都没有足够的空间上传文件,会在获取剩余空间失败的冲突路径(不含获取成功但容量不足)中随机选择一个。quota_strict:将quota的加粗字体改为会直接返回上传失败。Copy、Move、ArchiveDecompress操作会首先根据上传策略选择目标路径,然后对每个目标路径,判断源路径的所有冲突路径中有没有与目标冲突路径位于同一个驱动中的。如果有,会将二者匹配,执行相应操作。如果某个目标冲突路径没有找到与之匹配的源路径,会根据读取策略选择一个源路径进行跨驱动传输。还没写完,剩余工作:删除op层基于挂载路径实现的负载均衡功能,该功能不支持合并显示每个驱动中的内容,且实现方式与其它模块尤其是几个中间件驱动适配性较差。写完了,没删那个挂载路径里加
.balance进行负载均衡的功能,感觉适用场景和这个有点区别,优化了alias、strm和缓存模块对这个功能的支持。Motivation and Context / 背景
How Has This Been Tested? / 测试
粗浅测了一下,感觉没什么问题,测试充分程度不及这个 PR 的修改程度,最好再测一测。
没测负载均衡的两个文件内容不同的情况,这个 PR 也不打算兼容这种情况,当做未定义行为了
Checklist / 检查清单
我已阅读 CONTRIBUTING 文档。
go fmtor prettier.我已使用
go fmt或 prettier 格式化提交的代码。我已为此 PR 添加了适当的标签(如无权限或需要的标签不存在,请在描述中说明,管理员将后续处理)。
我已在适当情况下使用"Request review"功能请求相关代码作者进行审查。
我已相应更新了相关仓库(若适用)。