Skip to content

Deleting an app token doesn't remove its blob file in decomposedfs storage tree #3547

Description

@schweigisito

Describe the bug

Creating an app token creates a uuid-of-user.json file within the metadata storage path. This symlinks to a .mpk file, which itself references the actual data via the user.oc.blobid attribute.

Adding additional tokens creates a new blob file which contains both the previously and new newly created tokens. The .mpk file references the new blob file afterwards. The previous blob file is not deleted.

Also deleting all tokens doesn't trigger a blob file removal. All blobs persist but only the .mpk file doesn't reference them anymore.

Steps to reproduce

  • Create an app token
  • Check storage/metada on storage. It looks similar to this:
opencloud-api-675fd7bf75-nrhlx:~/storage$ tree -f metadata/spaces/js/oncs3-appauth-data/nodes/
metadata/spaces/js/oncs3-appauth-data/nodes
├── metadata/spaces/js/oncs3-appauth-data/nodes/40
│   └── metadata/spaces/js/oncs3-appauth-data/nodes/40/e8
│       └── metadata/spaces/js/oncs3-appauth-data/nodes/40/e8/95
│           └── metadata/spaces/js/oncs3-appauth-data/nodes/40/e8/95/04
│               ├── metadata/spaces/js/oncs3-appauth-data/nodes/40/e8/95/04/-08a9-4808-95de-7991f99c73a1
│               ├── metadata/spaces/js/oncs3-appauth-data/nodes/40/e8/95/04/-08a9-4808-95de-7991f99c73a1.mlock
│               └── metadata/spaces/js/oncs3-appauth-data/nodes/40/e8/95/04/-08a9-4808-95de-7991f99c73a1.mpk
├── metadata/spaces/js/oncs3-appauth-data/nodes/bf
│   └── metadata/spaces/js/oncs3-appauth-data/nodes/bf/a6
│       └── metadata/spaces/js/oncs3-appauth-data/nodes/bf/a6/85
│           └── metadata/spaces/js/oncs3-appauth-data/nodes/bf/a6/85/97
│               ├── metadata/spaces/js/oncs3-appauth-data/nodes/bf/a6/85/97/-53d9-405d-92fd-4149da6884ea
│               ├── metadata/spaces/js/oncs3-appauth-data/nodes/bf/a6/85/97/-53d9-405d-92fd-4149da6884ea.mlock
│               └── metadata/spaces/js/oncs3-appauth-data/nodes/bf/a6/85/97/-53d9-405d-92fd-4149da6884ea.mpk
└── metadata/spaces/js/oncs3-appauth-data/nodes/js
    └── metadata/spaces/js/oncs3-appauth-data/nodes/js/on
        └── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs
            └── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs/3-
                ├── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs/3-/appauth-data
                │   ├── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs/3-/appauth-data/1ae9fcae-4605-1041-86bf-a78ae5021412.json -> ../../../../../bf/a6/85/97/-53d9-405d-92fd-4149da6884ea
                │   └── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs/3-/appauth-data/1aeb7b1a-4605-1041-86c3-a78ae5021412.json -> ../../../../../40/e8/95/04/-08a9-4808-95de-7991f99c73a1
                ├── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs/3-/appauth-data.mlock
                └── metadata/spaces/js/oncs3-appauth-data/nodes/js/on/cs/3-/appauth-data.mpk
  • Check content of .mpk file. It contains e.g.
user.oc.blobid�$b33fcd3f-4cd1-4176-8051-d7434e20e144
  • Search for this blob:
$ find . -iname "*4cd1-4176-8051-d7434e20e144"
./metadata/spaces/js/oncs3-appauth-data/blobs/b3/3f/cd/3f/-4cd1-4176-8051-d7434e20e144

=> This file contains all already existing tokens

  • Create an additional token and check the .mpk file. Now it contains:
user.oc.blobid�$748a90a7-c792-456d-961e-d975d6ccee2c

and references the new blob file

$ find . -iname "*c792-456d-961e-d975d6ccee2c"
./metadata/spaces/js/oncs3-appauth-data/blobs/74/8a/90/a7/-c792-456d-961e-d975d6ccee2c
opencloud-api-675fd7bf75-nrhlx:~/storage$ cat ./metadata/spaces/js/oncs3-appauth-data/blobs/74/8a/90/a7/-c792-456d-961e-d975d6ccee2c

=> This file contains all tokens, including the new one.

Both blobs still exist:

$ tree -f metadata/spaces/js/oncs3-appauth-data/blobs | egrep 'c792-456d-961e-d975d6ccee2c|4cd1-4176-8051-d7434e20e144'
│               └── metadata/spaces/js/oncs3-appauth-data/blobs/74/8a/90/a7/-c792-456d-961e-d975d6ccee2c
│               └── metadata/spaces/js/oncs3-appauth-data/blobs/b3/3f/cd/3f/-4cd1-4176-8051-d7434e20e144
  • Finally delete all app tokens from that user

=> This just puts a {} to the existing .mpk file but nothing else gets deleted.

Expected behavior

  • There should't get any file versions created within the metadata decomposedfs.
  • All blobs should get deleted if no token exists anymore

Actual behavior

  • Data left overs, containing tokens, hashes, user references, etc.

Setup

The above steps have been reproduced on an opencloud k8s deployment using opencloud 7.2.4

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions