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

Decomposedfs treesizecheck #6556

Merged
merged 1 commit into from
Jun 23, 2023
Merged

Decomposedfs treesizecheck #6556

merged 1 commit into from
Jun 23, 2023

Conversation

rhafer
Copy link
Contributor

@rhafer rhafer commented Jun 19, 2023

This adds a cli command to verify the treesize metadata of a Space in decomposedfs

ocis decomposedfs check-treesize -r /root/.ocis/storage/users/ -n cc1a4ba9-75d5-43e7-853c-548e1726ef60
Checking treesizes in space: Admin (id: cc1a4ba9-75d5-43e7-853c-548e1726ef60)
treesizes mismatch for node: /test2/folder/folder/folder/folder/folder
        NodeId: 2f8d8188-8c66-4c4d-a29b-cee85e3097c3
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/2f/8d/81/88/-8c66-4c4d-a29b-cee85e3097c3
        calculated treesize: 1998
        treesize in metadata: 1996
treesizes mismatch for node: /test2/folder/folder/folder/folder
        NodeId: 73ccc33f-0a8b-4513-9e2c-161a9e551279
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/73/cc/c3/3f/-0a8b-4513-9e2c-161a9e551279
        calculated treesize: 1998
        treesize in metadata: 1996
treesizes mismatch for node: /test2/folder/folder/folder
        NodeId: 0b95ed50-1ff4-4e01-a23f-eb48a4bd8691
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/0b/95/ed/50/-1ff4-4e01-a23f-eb48a4bd8691
        calculated treesize: 1998
        treesize in metadata: 1996
treesizes mismatch for node: /test2/folder/folder
        NodeId: fb24f75a-511a-4d60-9c09-00771e49c590
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/fb/24/f7/5a/-511a-4d60-9c09-00771e49c590
        calculated treesize: 1998
        treesize in metadata: 1996
treesizes mismatch for node: /test2/folder
        NodeId: 8b4f9187-1510-400c-85e2-9f3534a9f2fb
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/8b/4f/91/87/-1510-400c-85e2-9f3534a9f2fb
        calculated treesize: 1998
        treesize in metadata: 1996
treesizes mismatch for node: /test2
        NodeId: 8cb2f568-b890-480d-88a6-e356b589747a
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/8c/b2/f5/68/-b890-480d-88a6-e356b589747a
        calculated treesize: 1998
        treesize in metadata: 1996
treesizes mismatch for space: Admin
        NodeId: cc1a4ba9-75d5-43e7-853c-548e1726ef60
        InternalPath: /root/.ocis/storage/users/spaces/cc/1a4ba9-75d5-43e7-853c-548e1726ef60/nodes/cc/1a/4b/a9/-75d5-43e7-853c-548e1726ef60
        calculated treesize: 93692124
        treesize in metadata: 93692118

It's meant for offline usage. E.g. for analyzing case like: https://github.com/owncloud/enterprise/issues/5783

Using it while the ocis server is running is possible but might produce inconsistent results, when e.g. files are being uploaded/copied/deleted while the tool is running.

@update-docs
Copy link

update-docs bot commented Jun 19, 2023

Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes.

@rhafer rhafer requested a review from aduffeck June 19, 2023 15:22
@rhafer rhafer force-pushed the decomposed-fsck branch 2 times, most recently from ba819c5 to c9266ad Compare June 20, 2023 10:38
@rhafer rhafer changed the title wip: Decomposedfs treesizecheck Decomposedfs treesizecheck Jun 20, 2023
@rhafer rhafer marked this pull request as ready for review June 20, 2023 10:40
@rhafer rhafer requested review from butonic and micbar June 20, 2023 10:40
@ownclouders
Copy link
Contributor

ownclouders commented Jun 20, 2023

💥 Acceptance test localApiTests-apiCors-ocis failed. Further test are cancelled...

@rhafer rhafer force-pushed the decomposed-fsck branch from c9266ad to e419c3b Compare June 20, 2023 13:04
@rhafer
Copy link
Contributor Author

rhafer commented Jun 22, 2023

BTW, I'd welcome ideas for how we could make this less disruptive. The current requirement to run this while the service is offline is not really practical, especially when the space is really large.

To somewhat reduce downtime it is already possible to run the tool without --repair to find out which spaces actually need repair, while the server is running. It might produce a couple of false positives (especially for busy spaces), but should still help.

Copy link
Collaborator

@kobergj kobergj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Just nitpicking for cosmetic change.

ocis/pkg/command/decomposedfs.go Outdated Show resolved Hide resolved
@rhafer rhafer force-pushed the decomposed-fsck branch from e419c3b to 4af4bba Compare June 22, 2023 13:58
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@rhafer
Copy link
Contributor Author

rhafer commented Jun 22, 2023

BTW, I'd welcome ideas for how we could make this less disruptive. The current requirement to run this while the service is offline is not really practical, especially when the space is really large.

I've created #6603 as a followup issue on this.

@micbar micbar merged commit aa4e490 into owncloud:master Jun 23, 2023
ownclouders pushed a commit that referenced this pull request Jun 23, 2023
@micbar micbar mentioned this pull request Jul 24, 2023
68 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants