-
Notifications
You must be signed in to change notification settings - Fork 6.9k
fix: restrict SinglePool by the minimum free drive threshold #21115
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
fix: restrict SinglePool by the minimum free drive threshold #21115
Conversation
fix: restrict SinglePool by the minimum free drive threshold
…nimum-free-drive-threshold
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why can't we directly check if there is available space?
if z.SinglePool() {
idx := z.getAvailablePoolIdx(ctx, bucket, object, data.Size())
if idx < 0 {
return ObjectInfo{}, toObjectErr(errDiskFull)
}
return z.serverPools[0].PutObject(ctx, bucket, object, data, opts)
}
@leoliulei what happens to existing versions? |
Put object will generate a temp object, This commit will also check whether there is available space when it encounters an existing version. |
|
The simplest way is indeed this, but we also fixed a BUG in the case of multiple pools, that is, multiple versions of files will not be restricted, just to unify the entry. @leoliulei @harshavardhana |
…nimum-free-drive-threshold
Yes, I agree with this. |
…nimum-free-drive-threshold
…nimum-free-drive-threshold
…nimum-free-drive-threshold
vadmeste
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiuker I think this is a bit expensive to issue a GetObjectInfo for every Put call.
Probably a better way is to return the appropriate no space error when any drive returns errDiskFull
…nimum-free-drive-threshold
…nimum-free-drive-threshold
But if the object are Decommissioned or Rebalanced, the pinfo, _, err := z.getPoolInfoExistingWithOpts(ctx, bucket, object, ObjectOptions{
SkipDecommissioned: true,
SkipRebalancing: true,
})will show the the exist object real pool index. Right @vadmeste |
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 15 days if no further activity occurs. Thank you for your contributions. |
fix: restrict SinglePool by the minimum free drive threshold
Community Contribution License
All community contributions in this pull request are licensed to the project maintainers
under the terms of the Apache 2 license.
By creating this pull request I represent that I have the right to license the
contributions to the project maintainers under the Apache 2 license.
Description
SinglePool is not restricted now.
And when the versioned object exist, still can uploaded with another version, maybe that is a big size.
Motivation and Context
How to test this PR?
Types of changes
Checklist:
commit-idorPR #here)