Skip to content
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

Upper case xattr incompatible to Amazon S3 #326

Closed
crazymind1337 opened this issue Oct 8, 2024 · 8 comments · Fixed by #327
Closed

Upper case xattr incompatible to Amazon S3 #326

crazymind1337 opened this issue Oct 8, 2024 · 8 comments · Fixed by #327
Labels
Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take

Comments

@crazymind1337
Copy link
Contributor

Hello

we are currently in the process of migrating our mirror servers to an versioned S3 bucket in kubernetes. With RPM repos we currently have the issue, that on each sync a new versioned RPM file is created. With using strace we have found out, that librepo uses xattr to set mtime and some file md5/sha256 hashes.

librepo sets an xattr user.Librepo.checksum., but Amazon S3 [1] stores its metadata always in lower case, so the attribute will be converted to user.librepo.checksum.. This results in an error on the next sync:

fgetxattr(9, "user.Librepo.checksum.mtime", 0x7ffcb473de40, 255) = -1 ENODATA (No data available)

After this error the xattr are set again which results in a new version copy of the file even if output of the dnf reposync says something like:

[SKIPPED] file1.rpm: Already downloaded
[SKIPPED] file2.rpm: Already downloaded
...

We also did some manual tests:

Setting the xattr:

xattr -w user.Librepo.checksum.mtime 1728288095870000000 test

Reading the xattr:

xattr -l test
user.librepo.checksum.mtime: 1728288095870000000

Is there any technical reason why the string has an upper case character?

Could this string be changed to a lower case character?

[1] https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingMetadata.html

@crazymind1337 crazymind1337 changed the title upper case xattr incompatible to versioned S3 buckets upper case xattr incompatible to Amazon S3 Oct 8, 2024
@crazymind1337 crazymind1337 changed the title upper case xattr incompatible to Amazon S3 Upper case xattr incompatible to Amazon S3 Oct 8, 2024
@m-blaha
Copy link
Member

m-blaha commented Oct 8, 2024

I don't think there is a technical reason for it, so I believe it can be changed.
There are two such attributes:

  • user.Librepo.DownloadInProgress to mark that the file is being downloaded using librepo and the download can be resumed after error,
  • and the mentioned user.Librepo.checksum.* set of attributes

@crazymind1337
Copy link
Contributor Author

Nice - I am already creating a PR for that. Found those two xattr already ;-)

crazymind1337 added a commit to crazymind1337/librepo that referenced this issue Oct 8, 2024
Convert all xattr strings to lower case to be compatible to Amazon S3 buckets.
@crazymind1337
Copy link
Contributor Author

PR created. Is there something else to do?

@m-blaha m-blaha mentioned this issue Oct 8, 2024
@m-blaha m-blaha linked a pull request Oct 8, 2024 that will close this issue
@m-blaha
Copy link
Member

m-blaha commented Oct 8, 2024

Thank you very much for the PR!

@ppisar ppisar added the Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take label Oct 8, 2024
@crazymind1337
Copy link
Contributor Author

I don't want to hurry, but can you give an ETA for this to be ready and available for install on RHEL9?

m-blaha pushed a commit that referenced this issue Oct 9, 2024
Convert all xattr strings to lower case to be compatible to Amazon S3 buckets.
@m-blaha
Copy link
Member

m-blaha commented Oct 9, 2024

To get this fix released in RHEL9 - would you mind filing an RHEL project issue in the Jira - https://issues.redhat.com/browse/RHEL . Then the issue can be planned for one of the future RHEL9 releases.

@crazymind1337
Copy link
Contributor Author

crazymind1337 commented Oct 11, 2024

Done: https://issues.redhat.com/browse/RHEL-62033

We also tested the update with a manual compilation and installation: No more new version copies. >> fixed.

Edit1: There are still version copys. Because reposync downloads the files and initially sets the xattr. Each setting of an xattr results in a new version copy. BUT this wont happen after the initial sync anymore. So just partially fixed.

Edit2: Nevermind (sorry) ... librepo updates the xattr even if there is no change. °_° This results of course in new versions.

@m-blaha
Copy link
Member

m-blaha commented Oct 11, 2024

Regarding the RHEL issue, it would be much easier to triage and plan if the bug report included a detailed description of the actual issue (for instance, you could copy the title and description from this GitHub issue). A request for a new release is a bit too general. Would you be open to editing or re-creating the issue with more specific details?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Triaged Someone on the DNF 5 team has read the issue and determined the next steps to take
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants