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

Decomposed based posix filesystem driver #4562

Merged
merged 103 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
f4cbeb4
Switch posixfs to a local decomposedfs copy for now
aduffeck Feb 2, 2024
228be02
Fix creating/listing spaces
aduffeck Feb 6, 2024
8d3519c
Fix creating/listing dirs
aduffeck Feb 6, 2024
2592894
More fixes for CreateDir
aduffeck Feb 6, 2024
8612f5e
Don't do trashbin for now
aduffeck Feb 6, 2024
59a4506
Fix moving items
aduffeck Feb 7, 2024
a4838fb
Fix TouchFile
aduffeck Feb 7, 2024
db5b57f
Use inotifywatch to get notified about changes on disk
aduffeck Feb 7, 2024
6ed6c3e
Fix blobstore to retrieve the blob from the actual files
aduffeck Feb 7, 2024
9b45d3e
Use the proper lockfile extension for the meta lockfile
aduffeck Feb 7, 2024
372a50c
Ignore file with missing metadata
aduffeck Feb 7, 2024
643d5e1
Do not abort the watcher in case of errors
aduffeck Feb 7, 2024
c6b1b1f
Fix assimilating directories
aduffeck Feb 7, 2024
bbffead
Fix file uploads. Disable versioning for now.
aduffeck Feb 8, 2024
26efd39
Guard map access using a mutex
aduffeck Feb 8, 2024
03e0f3f
Scan files asynchronously
aduffeck Feb 8, 2024
43c6ebe
Lock the metadata when creating a dir
aduffeck Feb 8, 2024
07b2d79
Fix handling node ids when creating nodes
aduffeck Feb 8, 2024
be1878f
Remove decomposedfs layout specifics
aduffeck Feb 8, 2024
69625f3
Fix scanning new files
aduffeck Feb 8, 2024
07d3c17
Calculate checksums for assimilated files
aduffeck Feb 9, 2024
b3e7c7e
Make the upload folder configurable and make sure it exists
aduffeck Feb 9, 2024
718ef96
Create a new id if it's not set
aduffeck Feb 9, 2024
a9d7d47
Switch to github.com/aduffeck/inotifywaitgo to fix files with spaces
aduffeck Feb 9, 2024
9438606
Rescan the whole directory recursively if a directory was renamed
aduffeck Feb 12, 2024
7a9ef70
Fix a timing issue when touching files
aduffeck Feb 12, 2024
e06da68
Be more thorough cleaning up the meta lockfiles
aduffeck Feb 12, 2024
d97491a
Implement project spaces
aduffeck Feb 14, 2024
9d9a822
Switch back to upstream inotifywaitgo
aduffeck Feb 23, 2024
99d3e42
Make fs watching modular, introduce gpfsfileauditlogging watcher
aduffeck Feb 23, 2024
5a95bdb
Try to assimilate the parent before assimilating the item
aduffeck Feb 26, 2024
cf0f852
Fix deleting non-empty dirs
aduffeck Feb 26, 2024
b540d32
Switch to a store based id cache
aduffeck Feb 28, 2024
c0c7716
Add a "watchfolder" based gpfs watcher
aduffeck Mar 1, 2024
f4abdc4
Fix event names to listen for
aduffeck Mar 5, 2024
bf0b77e
Add a queue for items to be assimilated/scanned
aduffeck Mar 5, 2024
573f971
Fix recursive reindexing of moved directories
aduffeck Mar 5, 2024
9a78232
Fix reindexing
aduffeck Mar 5, 2024
4ff0d4f
Clean up mlock file after propagation
aduffeck Mar 5, 2024
232ce05
Take the list of kafka brokers from the config
aduffeck Mar 5, 2024
b27a7f8
Improve error logging
aduffeck Mar 11, 2024
c174301
Sync with decomposedfs from edge
aduffeck Mar 12, 2024
498764b
Fix space indexes
aduffeck Mar 12, 2024
f8b3c36
Get rid of the posix specific decomposedfs lib
aduffeck Mar 12, 2024
7088721
Refactor decomposedfs to be more extensible, e.g. for the posix driver
aduffeck Mar 18, 2024
3808c44
Improve logging
aduffeck Mar 18, 2024
8169ddc
Do not use a UserLayout by default
aduffeck Mar 18, 2024
9994da8
Fix creating new nodes
aduffeck Mar 18, 2024
b8098a7
Fix uploads
aduffeck Mar 18, 2024
eb5c8d9
Solve user mapping using a DecomposedFS middleware layer
aduffeck Apr 9, 2024
97f853f
Do not switch the user for project spaces. They belong to the ocis user
aduffeck Apr 22, 2024
5cb7687
Do not lock metadata by hand, use the metadata backend instead
aduffeck Apr 22, 2024
aba72a3
Do not switch the group id anymore
aduffeck Apr 22, 2024
fc1b603
Turn the user mapper into an interface for testability
aduffeck Apr 22, 2024
a4515c4
Pass the space type to the middlewares, so they can act accordingly
aduffeck Apr 22, 2024
86913ad
WIP
aduffeck Apr 23, 2024
7aef5d1
Merge branch 'more-extensible-decomposedfs' into decomposed-based-pos…
aduffeck Apr 23, 2024
3f13aee
Do not switch the uid anymore
aduffeck Apr 29, 2024
5cf4b81
Fix switching gid per space
aduffeck Apr 29, 2024
d9480bd
Set a null usermapper for non-switching fses
aduffeck Apr 29, 2024
1254b32
Create spaces with g+rx
aduffeck Apr 29, 2024
4c58789
Check if the space already exists before creating it
aduffeck Apr 29, 2024
58ad611
Fix updating storage spaces
aduffeck Apr 30, 2024
3fd1e9b
Give everything some time to settle down before assimilating
aduffeck Apr 30, 2024
4dfc398
Switch user when listing folder concurrently
aduffeck Apr 30, 2024
22aafd1
Set proper permission on spaces and the space base dir
aduffeck May 2, 2024
3025612
Panic if the inotifywait dependency is not fulfilled
aduffeck May 2, 2024
962aca7
Remove dead code
aduffeck May 2, 2024
c8264f7
Merge remote-tracking branch 'upstream/edge' into decomposed-based-po…
aduffeck May 6, 2024
d3520a7
Fix several issues and races in the posixfs driver
aduffeck May 15, 2024
d9d1a7d
Add pipeline for the posixfs driver
aduffeck May 15, 2024
3e37dd8
Merge remote-tracking branch 'upstream/edge' into decomposed-based-po…
aduffeck May 15, 2024
e5993ab
go mod tidy
aduffeck May 15, 2024
7ebebfd
Bump golang ci image
aduffeck May 16, 2024
e7bd1ec
Do not gather space gids when they are not needed
aduffeck May 16, 2024
74d268f
Bump ocis commit for the api tests
aduffeck May 16, 2024
0ebeeff
Kill previous watchers before starting a new one
aduffeck May 21, 2024
98dec69
Also listen to CLOSE_WRITE events to pick up changed files
aduffeck May 21, 2024
3b65e53
Only change the gid when the according option is enabled
aduffeck May 21, 2024
9e6bd81
Be more efficient and robus when assimilating. Fix updating on changes.
aduffeck May 21, 2024
fc610bc
Add unit tests
aduffeck May 21, 2024
38fa5d7
Fix treesize when assimilating directories. Increase test coverage.
aduffeck May 21, 2024
ccb49a6
Fix propagation
aduffeck May 22, 2024
190f4b1
Make the inotifywait watcher less verbose
aduffeck May 22, 2024
b0f46f2
Handle propagation errors
aduffeck May 22, 2024
ef70290
Try to make the tests more robust
aduffeck May 22, 2024
7171a68
Preserve treesize when assimilating moved directories
aduffeck May 22, 2024
1758f9b
Try to make tests more robust
aduffeck May 22, 2024
6878d90
Fix moving directories
aduffeck May 22, 2024
d63479c
Pin the image digest to pull in the inotifywait dependency
aduffeck May 23, 2024
e0bff14
Fix updating the id cache after a move
aduffeck May 23, 2024
c0ed917
Debounce scans for the same path
aduffeck May 23, 2024
ba18257
Update id cache for moved subtrees
aduffeck May 23, 2024
1e6267f
Merge remote-tracking branch 'upstream/edge' into decomposed-based-po…
aduffeck May 23, 2024
7158582
Adapt expected failures
aduffeck May 23, 2024
b635c61
Do not re-assimilate the whole tree after a move, just update the caches
aduffeck May 23, 2024
e3aa42e
Merge remote-tracking branch 'upstream/edge' into decomposed-based-po…
aduffeck May 28, 2024
c128a93
Adjust adapted failures
aduffeck May 28, 2024
9e67598
Try to fix the flakiness in CI
aduffeck May 28, 2024
712e922
Adjust adapted failures
aduffeck May 28, 2024
2b6c55c
Try to fix the flakiness
aduffeck May 28, 2024
06f6a5f
Adjust expected failures
aduffeck May 28, 2024
5ff2e82
Add changelog
aduffeck May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 80 additions & 3 deletions .drone.star
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# images
OC_CI_GOLANG = "owncloudci/golang:1.21"
OC_CI_GOLANG = "owncloudci/golang:1.22@sha256:bc1ff4ac994a432146b0424207ca89985491496fcc534156cad5ad5d9e7e216d"
OC_CI_ALPINE = "owncloudci/alpine:latest"
OSIXIA_OPEN_LDAP = "osixia/openldap:1.3.0"
REDIS = "redis:6-alpine"
Expand Down Expand Up @@ -103,7 +103,7 @@ def cephService():
def main(ctx):
# In order to run specific parts only, specify the parts as
# ocisIntegrationTests(6, [1, 4]) - this will only run 1st and 4th parts
# implemented for: ocisIntegrationTests and s3ngIntegrationTests
# implemented for: ocisIntegrationTests, posixfsIntegrationTests and s3ngIntegrationTests
return [
checkStarlark(),
checkGoGenerate(),
Expand All @@ -117,7 +117,7 @@ def main(ctx):
cs3ApiValidatorS3NG(),
# virtual views don't work on edge at the moment
#virtualViews(),
] + ocisIntegrationTests(6) + s3ngIntegrationTests(12)
] + ocisIntegrationTests(6) + s3ngIntegrationTests(12) + posixfsIntegrationTests(6)

def coverage():
return {
Expand Down Expand Up @@ -705,6 +705,83 @@ def s3ngIntegrationTests(parallelRuns, skipExceptParts = []):

return pipelines

def posixfsIntegrationTests(parallelRuns, skipExceptParts = []):
pipelines = []
debugPartsEnabled = (len(skipExceptParts) != 0)
for runPart in range(1, parallelRuns + 1):
if debugPartsEnabled and runPart not in skipExceptParts:
continue

pipelines.append(
{
"kind": "pipeline",
"type": "docker",
"name": "posixfs-integration-tests-%s" % runPart,
"platform": {
"os": "linux",
"arch": "amd64",
},
"trigger": {
"ref": [
"refs/heads/master",
"refs/heads/edge",
"refs/pull/**",
],
},
"steps": [
makeStep("build-ci"),
{
"name": "revad-services",
"image": OC_CI_GOLANG,
"detach": True,
"commands": [
"cd /drone/src/tests/oc-integration-tests/drone/",
"/drone/src/cmd/revad/revad -c frontend.toml &",
"/drone/src/cmd/revad/revad -c gateway.toml &",
"/drone/src/cmd/revad/revad -c shares.toml &",
"/drone/src/cmd/revad/revad -c storage-shares.toml &",
"/drone/src/cmd/revad/revad -c machine-auth.toml &",
"/drone/src/cmd/revad/revad -c storage-users-posixfs.toml &",
"/drone/src/cmd/revad/revad -c storage-publiclink.toml &",
"/drone/src/cmd/revad/revad -c permissions-ocis-ci.toml &",
"/drone/src/cmd/revad/revad -c ldap-users.toml",
],
},
cloneApiTestReposStep(),
{
"name": "APIAcceptanceTestsPosixStorage",
"image": OC_CI_PHP,
"commands": [
"cd /drone/src/tmp/testrunner",
"make test-acceptance-from-core-api",
],
"environment": {
"TEST_SERVER_URL": "http://revad-services:20080",
"OCIS_REVA_DATA_ROOT": "/drone/src/tmp/reva/data/",
"DELETE_USER_DATA_CMD": "rm -rf /drone/src/tmp/reva/data/users/* /drone/src/tmp/reva/data/indexes/by-type/*",
"STORAGE_DRIVER": "ocis",
"SKELETON_DIR": "/drone/src/tmp/testing/data/apiSkeleton",
"TEST_WITH_LDAP": "true",
"REVA_LDAP_HOSTNAME": "ldap",
"TEST_REVA": "true",
"SEND_SCENARIO_LINE_REFERENCES": "true",
"BEHAT_FILTER_TAGS": "~@toImplementOnOCIS&&~comments-app-required&&~@federation-app-required&&~@notifications-app-required&&~systemtags-app-required&&~@provisioning_api-app-required&&~@preview-extension-required&&~@local_storage&&~@skipOnOcis-OCIS-Storage&&~@skipOnGraph&&~@caldav&&~@carddav&&~@skipOnReva&&~@env-config",
"DIVIDE_INTO_NUM_PARTS": parallelRuns,
"RUN_PART": runPart,
"EXPECTED_FAILURES_FILE": "/drone/src/tests/acceptance/expected-failures-on-POSIX-storage.md",
},
},
],
"services": [
redisService(),
ldapService(),
],
"depends_on": ["unit-test-coverage"],
},
)

return pipelines

def checkStarlark():
return {
"kind": "pipeline",
Expand Down
3 changes: 3 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ packages:
github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/tree:
interfaces:
Blobstore:
github.com/cs3org/reva/v2/pkg/storage/utils/decomposedfs/usermapper:
interfaces:
Mapper:
github.com/cs3org/reva/v2/pkg/storage/utils/indexer:
interfaces:
Indexer:
Expand Down
5 changes: 5 additions & 0 deletions changelog/unreleased/improve-posixfs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Improve posixfs storage driver

Improve the posixfs storage driver by fixing several issues and adding missing features.

https://github.com/cs3org/reva/pull/4562
12 changes: 10 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ require (
github.com/go-micro/plugins/v4/events/natsjs v1.2.2-0.20231215124540-f7f8d3274bf9
github.com/go-micro/plugins/v4/server/http v1.2.2
github.com/go-micro/plugins/v4/store/nats-js v1.2.0
github.com/go-micro/plugins/v4/store/nats-js-kv v0.0.0-20231226212146-94a49ba3e06e
github.com/go-micro/plugins/v4/store/redis v1.2.1
github.com/go-playground/locales v0.14.1
github.com/go-playground/universal-translator v0.18.1
Expand Down Expand Up @@ -61,13 +62,15 @@ require (
github.com/onsi/ginkgo/v2 v2.15.0
github.com/onsi/gomega v1.31.1
github.com/owncloud/ocis/v2 v2.0.0
github.com/pablodz/inotifywaitgo v0.0.6
github.com/pkg/errors v0.9.1
github.com/pkg/xattr v0.4.9
github.com/prometheus/alertmanager v0.26.0
github.com/prometheus/client_golang v1.18.0
github.com/rogpeppe/go-internal v1.12.0
github.com/rs/cors v1.10.1
github.com/rs/zerolog v1.32.0
github.com/segmentio/kafka-go v0.4.47
github.com/sethvargo/go-password v0.2.0
github.com/shamaton/msgpack/v2 v2.1.1
github.com/stretchr/testify v1.8.4
Expand All @@ -88,7 +91,7 @@ require (
golang.org/x/exp v0.0.0-20240205201215-2c58cdc269a3
golang.org/x/oauth2 v0.17.0
golang.org/x/sync v0.6.0
golang.org/x/sys v0.17.0
golang.org/x/sys v0.19.0
golang.org/x/term v0.17.0
golang.org/x/text v0.14.0
google.golang.org/genproto v0.0.0-20240205150955-31a09d347014
Expand Down Expand Up @@ -136,7 +139,7 @@ require (
github.com/go-micro/plugins/v4/registry/mdns v1.2.0 // indirect
github.com/go-micro/plugins/v4/registry/memory v1.2.0 // indirect
github.com/go-micro/plugins/v4/registry/nats v1.2.1 // indirect
github.com/go-micro/plugins/v4/store/nats-js-kv v0.0.0-20231226212146-94a49ba3e06e // indirect
github.com/go-ole/go-ole v1.2.6 // indirect
github.com/go-openapi/errors v0.20.4 // indirect
github.com/go-openapi/strfmt v0.21.7 // indirect
github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect
Expand Down Expand Up @@ -185,6 +188,7 @@ require (
github.com/oklog/ulid v1.3.1 // indirect
github.com/oxtoacart/bpool v0.0.0-20190530202638-03653db5a59c // indirect
github.com/patrickmn/go-cache v2.1.0+incompatible // indirect
github.com/pierrec/lz4/v4 v4.1.15 // indirect
github.com/pkg/term v1.2.0-beta.2 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_model v0.5.0 // indirect
Expand All @@ -195,14 +199,18 @@ require (
github.com/rs/xid v1.5.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect
github.com/sergi/go-diff v1.2.0 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shurcooL/httpfs v0.0.0-20190707220628-8d4bc4ba7749 // indirect
github.com/shurcooL/vfsgen v0.0.0-20200824052919-0d455de96546 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/tidwall/pretty v1.2.1 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
github.com/tklauser/numcpus v0.8.0 // indirect
github.com/urfave/cli/v2 v2.25.7 // indirect
github.com/xanzy/ssh-agent v0.3.2 // indirect
github.com/xrash/smetrics v0.0.0-20201216005158-039620a65673 // indirect
github.com/yusufpapurcu/wmi v1.2.4 // indirect
go.etcd.io/etcd/api/v3 v3.5.12 // indirect
go.etcd.io/etcd/client/pkg/v3 v3.5.12 // indirect
go.mongodb.org/mongo-driver v1.11.3 // indirect
Expand Down
Loading
Loading