geesefs icon indicating copy to clipboard operation
geesefs copied to clipboard

Feature request: set file's `mtime`

Open Felixoid opened this issue 1 year ago • 5 comments

Hello, thanks for a great tool, it's much faster than s3fs

We have a feature request that would make it a magnitude more useful with rsync.

Now I have to sync files as rsync --no-times --size-only --delete src dst, and it has an obvious flaw. It works more or less for big files, but when the file's size remains the same it won't be updated.

Felixoid avatar Sep 22 '22 08:09 Felixoid

This will help to set up the package repository for ClickHouse.

alexey-milovidov avatar Sep 22 '22 08:09 alexey-milovidov

Hi, problem is that S3 (at least, standard S3) doesn't have good place to put mtime. It's a poorly designed API :-D. The only place where it's possible to save mtime is UserMetadata. But in standard S3, UserMetadata isn't returned in listings (ListObjects responses). You have to issue separate HEAD requests for every object to fetch UserMetadata which is obviously awfully slow. We fixed that with list-type=ext-v1, but it only works with Yandex S3 and I suspect you use something else :-)

You can try to use cp -u (--update) as a partial workaround.

vitalif avatar Sep 22 '22 08:09 vitalif

Yes, we use CloudFlare R2.

And I've already found an issue with it today. repomd.xml* files in https://packages.clickhouse.com/rpm/lts/repodata/ aren't updated with --size-only

I use a complex rsync filters with a few steps, to upload artifact first, and then the metadata. cp --update looks the same as just rsync, that looks on mtime.

Felixoid avatar Sep 22 '22 16:09 Felixoid

The difference is that cp --update uploads a file if src mtime is > dst mtime, and rsync uploads it if src mtime != dst mtime. And as it's generally impossible to make src mtime equal to dst mtime with geesefs rsync mtime checking becomes pointless.

vitalif avatar Sep 22 '22 17:09 vitalif

Oh, it's very important detail indeed. Thanks, I'll try adopting it

Felixoid avatar Sep 22 '22 18:09 Felixoid