Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jiuker
Copy link
Contributor

@jiuker jiuker commented Apr 9, 2025

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

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Optimization (provides speedup with no functional changes)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • Fixes a regression (If yes, please add commit-id or PR # here)
  • Unit tests added/updated
  • Internal documentation updated
  • Create a documentation update request here

fix: restrict SinglePool by the minimum free drive threshold
jiuker added 3 commits April 9, 2025 11:53
lint
pinfo err
change condition
Copy link

@leoliulei leoliulei left a 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)
	}

@harshavardhana
Copy link
Member

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?

@leoliulei
Copy link

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.

@jiuker
Copy link
Contributor Author

jiuker commented Apr 11, 2025

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

@leoliulei
Copy link

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

Yes, I agree with this.

Copy link
Member

@vadmeste vadmeste left a 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

@jiuker
Copy link
Contributor Author

jiuker commented Jun 9, 2025

@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

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

@stale
Copy link

stale bot commented Jul 19, 2025

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.

@stale stale bot added the stale label Jul 19, 2025
@stale stale bot removed the stale label Jul 19, 2025
@harshavardhana harshavardhana merged commit 83b2ad4 into minio:master Jul 19, 2025
20 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants