self heal treesize when listing folders
- Dominant language
- Go
- Stars
- 2.1k
- Forks
- 274
- Avg merge
- 2d 1h
- Merged PRs (30d)
- 103
Description
With https://github.com/owncloud/ocis/pull/5092 we are now propagating a size diff instead of recalculating a directory size. While the propagation code is covered by acceptance tests I think we should implement a form of self healing for the treesize property.
Whenever a directory is listed we can summarize the size of the children and compare that with the parent treesize. If it is different we can log a warning and overwrite the parent treesize with the correct result.
There might be corner cases wher a new file is being written while listing a directory though. we could loose the sizediff when the listing did not contain the new file and its propagation finished before listing the directory is done. we should be able to detect that with an etag comparison befor trying to update the treetime, though. in that case we should probably not log the warning, stay silent and just do nothing.
This would prevent admins from having to manually update the treesize or us writing a cli command for that task.
Contributor guide
Assessment
This issue has not been assessed yet.