nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.41k stars 4.07k forks source link

Recover Orphans from ObjectStore #34509

Open ArtificialOwl opened 2 years ago

ArtificialOwl commented 2 years ago

The idea is to improve the management of objects from ObjectStorage and helps administrator to manage orphans that might appears on a de-sync between the table filecache and the objects stored on S3.

The development of this feature can be split in 3 steps:

first step:

second step:

third step:

side note: the occ command to list Orphans should be able to also compare filesize and fix the data from the table filecache.

mrAceT commented 2 years ago

This I've done in a stand alone program.. and I'm willing to share the days of testing, debugging, more testing etc I did to rescue/migrate my NextCloud instance with the community.. but I do have a few "conditions".

I see you have contributed to this project in the past and that you also seem to have knowledge of "the AWS S3" part, could you please give me an answer to:

March 24, 2022: AWS s3 as primary storage & redundancy https://help.nextcloud.com/t/aws-s3-as-primary-storage-redudancy/136202 In the current structure the table 'oc_filecache' is the Achilles heal of the NexCloud S3 structure. I have a master-slave setup to mitigate this, but In my opinion this problem would be easily fixed when a "S3 file" would NOT have the name "urn:oid:123456" but its actual file and folder name?

Then one could also manually remove stuff and perform a "files:scan --all" to clean the data etc etc. Then the S3 storage structure could perform much more the same as the "regular one". Now S3 needs to be used as a database with a relational database.. one can not exist without the other making them 100% dependent on each other AND much more vulnerable to trouble..

Oct 4, 2022: quota S3 storage wrong WITH Q&D FIX! https://github.com/nextcloud/server/issues/34422 This one already shared completely. There is a quota problem somewhere where sometimes "a bit flips" more or less bricking the S3 quota system. I've had this problem on and off for about a year and in "utter frustration" I've spent quit a bit of time mitigating this problem and I managed to "hack" a Q&D fix (I'll admit quite "D" ;) ). I'd very much appreciate it when someone like you would take a look at it (and hopefully create a real fix why that darn un-editable 2GB quota pops up)..

That stand alone program.. what it does for me:

As you might have guessed, I built it for migrating from local to S3. But when already migrated it can function as a "S3 sanity check"

joshtrichards commented 1 year ago

Related: #30824