这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@erwanlpfr
Copy link
Contributor

@erwanlpfr erwanlpfr commented May 8, 2023

Hello,

Here, a potential PR to allow a better handling with part size.
The problem solved is when uploading large files, the part size can be limiting.

In my case, I use S3 from scaleway and the counter size is set to 1.000 where in AWS is 10.000.
It can be problematic since Minio hard coded this. So by setting, at least, a size part I can prevent this value to reach or get over 1000.

So, what I changed :

  • Adding a default value to set the part size in env vars.
  • use it as parameters and compute an optimal value according to minio (which uses the counter size set to 10000).
  • use it as put parameter to copy the file.
  • also, little upgrade of packages.

I am not a go dev, so let me know if I need to change stuff.

I am testing the PR in multiple cases, so I will let you know when it works for me.
Let me know also, if you try, if it works.

EDIT : It doesn't work as it, so it is stil a draft.

@erwanlpfr erwanlpfr marked this pull request as ready for review May 9, 2023 15:54
@erwanlpfr
Copy link
Contributor Author

@m90 Hello, I think it works.
I was able to upload a 30 GB file into my scaleway cluster.

Let me know if you don't have any side effects !

Copy link
Member

@m90 m90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this. I left a few comments, if you have any questions please inquire further. Also, CI is currently not passing when storing data in MinIO, so there seems to be something in the code that breaks the existing behavior. Let me know if you need help debugging this.

README.md Outdated
- [Using mysqldump to prepare the backup](#using-mysqldump-to-prepare-the-backup)
- [Running multiple instances in the same setup](#running-multiple-instances-in-the-same-setup)
- [Differences to `futurice/docker-volume-backup`](#differences-to-futuricedocker-volume-backup)
- [docker-volume-backup](#docker-volume-backup)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these changes to the TOC accidental?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This somehow resurfaced, could you undo the changes again?

@erwanlpfr
Copy link
Contributor Author

Hello, I saw your review !
Thank you!
I will try to do so, probably next week!

Btw, about the upgrade of Minio.
It is not necessary needed but VSCode was telling me there was an update and since it is only patch,
I assumed there was no breaking change!
Let me know if I keep that!

@m90
Copy link
Member

m90 commented May 19, 2023

It is not necessary needed but VSCode was telling me there was an update and since it is only patch,

In case it's not related to the feature, I'd prefer to stick to the version main is using in this PR. Like this there are as few moving parts as possible in this changeset and it's easier to figure out its consequences. MinIO can always be upgraded on its own.

erwanlpfr added 3 commits June 1, 2023 21:41
fix: use local file 


fix: try with another path


fix: use bytes 


chore: go back


go back readme


goback


goback


goback
@erwanlpfr
Copy link
Contributor Author

Hello !

I got time to continue,
I am actually testing cases in my side.

Let me know if everything's okay!

Copy link
Member

@m90 m90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good now, I think I spotted one logic mistake though. Let me know if that makes sense.

}); err != nil {
}

if b.partSize < 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wouldn't this need to be

if b.partSize > 0 {

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right ^^

README.md Outdated
# While Minio uses a hard coded value to 10.000. As a workaround, try to set a higher value.
# Defaults to "16" (MB) if unset (from minio), you can set this value according to your needs.

# AWS_PART_SIZE=
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# AWS_PART_SIZE=
# AWS_PART_SIZE=1000

I think it'd be good to set an example value here so people know how the number is expected to be formatted. E.g. right now I'm not sure if I'm expected to pass 1.000 or 1000.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, I'll take all in consideration and I will commit as soon as I can !

@erwanlpfr
Copy link
Contributor Author

Done ! I'm doing my tests, let me know if yours pass also !

@erwanlpfr
Copy link
Contributor Author

Worked !
So let me know if it is good for you!

@m90 m90 merged commit 5ea9a7c into offen:main Jun 2, 2023
@m90
Copy link
Member

m90 commented Jun 2, 2023

This is now released as v2.28.0 - thanks for your contribution 🎩

@erwanlpfr erwanlpfr deleted the feat/smart-part-size-s3 branch June 2, 2023 15:46
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.

2 participants