Skip to content

S3 storage backend is not sync-friendly #60

@aldanor

Description

@aldanor

This took me a good while to figure out: I was moving my S3-backed Cronicle db from one S3 storage provider to another, and decided to sync the whole thing with rclone. Everything was seemingly fine, except for the fact that the UI was stuck in "waiting for a master" state. After a fair bit of digging and debugging, I figured that the sync was only partially complete, and looked like this in the destination bucket:

...
servers
server_groups
...

... and like this in the source bucket:

...
servers
servers/0
server_groups
server_groups/0

The core problem here being - that there's both a "folder" servers and a "file" servers (which apparently serves as a sort of a metadata header to the "folder"). Soon as the sync tool discovers the "file", it doesn't consider it a "folder" anymore and doesn't go digging any further, hence ignoring everything that looks like servers/*. I think this happened with s3cmd as well in the past, not just rclone, but I haven't given it any thought back then - so it might need additional checking. You could say it's an rclone problem (which it is, partially), but given that I couldn't find a single person running into the same issue with either rclone/s3cmd, it looks like people just don't name their s3 objects this way, so the cli tools wouldn't care to handle it either.

Another side of the same problem here would be trying to sync S3 tree to a local disk -- since you can't have a file and a folder with the same name, what would you expect it to do? (and this is most likely the reason sync tools behave the way they do, ignoring servers/0)

I understand that this might be too much of a change, and even if a workaround was implemented (like an optional suffix/prefix for the metadata object so it doesn't collide with the contents), some thought would have to be given to compatibility and migration questions. I'd be happy to discuss this though if it helps anything.

If allowing to change this convention happens to be an absolute no-no, maybe there should at least be a note somewhere saying "don't ever try to sync your cronicle s3 installation with any of the standard s3 command line tools like rclone, it will fail miserably (and worst of all, quietly)".

Thanks!

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions