add command to repair broken filesystem trees#25189
Merged
Conversation
a70ce55 to
cf26569
Compare
rullzer
approved these changes
Jan 20, 2021
Member
rullzer
left a comment
There was a problem hiding this comment.
Makes sense
But I didn't test it. Is there an easy way to test it?
Member
Author
|
you can manually break your filesystem tree by changing the |
9884fc2 to
ef9f205
Compare
Signed-off-by: Robin Appelman <robin@icewind.nl>
Signed-off-by: Robin Appelman <robin@icewind.nl>
…y been recreated Signed-off-by: Robin Appelman <robin@icewind.nl>
ChristophWurst
approved these changes
Jan 27, 2021
Member
ChristophWurst
left a comment
There was a problem hiding this comment.
Code makes sense as far as I understand the file cache
👍 (🐘)
ef9f205 to
1ecc029
Compare
Member
|
would be good to have unit tests to confirm that this isn't causing any side effects something like https://github.com/owncloud/core/pull/28253/files#diff-61c2bd81935832b24f87e329f7b6374aa736b3d7c74196581abe0892d983303e |
Member
Author
|
/backport to stable20 |
Member
Author
|
/backport to stable19 |
This was referenced Apr 19, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If for any reason the path of an entry in the filecache doesn't match with it's expected path based on the path of it's parent node you end up with an entry in the filecache that exists in different places based on how the entry is generated. For example, while listing folder
/foois contains a filebar.txt, but when trying to do anything with/foo/bar.txtthe file doesn't exists.This command attempts to repair such entries by querying for entries there the path doesn't match the expected path based on it's parent path and filename and resets it's path to the expected one.
It is not guaranteed that the "new" path is the correct one, but while that would leave the filecache and actual filesystem out of sync, various automated and manual processes to fix that already exist as filecache synchronization is a much wider topic.
By comparison there isn't currently any way (short of manual database editing) to repair a broken file tree.