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

Leave home prefixing to the storage provider #577

Merged
merged 5 commits into from
Mar 19, 2020

Conversation

butonic
Copy link
Contributor

@butonic butonic commented Mar 19, 2020

Currently, the Path is prefixed twice. Once by the storage provider and once by the gateway.

Leave it to the gateway.

Followup of #562

Signed-off-by: Jörn Friedrich Dreyer <[email protected]>
@butonic butonic requested a review from labkode as a code owner March 19, 2020 09:37
@labkode
Copy link
Member

labkode commented Mar 19, 2020

@butonic I am bit lost with these changes.

The storage provider will prefix with the mount point. The storage driver will provide a home path relative to the storage driver. Why the gateway would prefix the response? Shouldn't this be the storage provider already?

SP = Storage Provider
SD = Storage Driver

SD exposes "/" for home of "jorn", internally is "/var/data/users/jorn"
SP exposes "/home", so wrapping inner SD, "/home/" is the home path for "jorn"

The logic should be inverted, the wrapping should happen on the storage provider not the gateway.

@butonic
Copy link
Contributor Author

butonic commented Mar 19, 2020

IMO

  • the storage driver returns a relative path, hiding any internal storage layout
  • the storage provider just returns this relative path because it should not know anything about where it is mounted
  • the storage registry knows where storae providers are mounted in the global namespace
  • the gateway should prefix the home path with the mount point of the storage to combine the knowledge from the storage registry and the storage provider

If the storage provider knows about the outside world it becomes harder to move storages in the global storage, because you have to configure it in two places: the registry and the storage provider.

The gateway is responsible for routing requests to the correct storage and the storage registry stores the mount path & storage id mapping for the storage providers.

AFAICT the storage provider should only know its ID.

@labkode
Copy link
Member

labkode commented Mar 19, 2020

@butonic that is not how the system was designed. Every storage provider provides a unique mount path to create a distributed unique namespace, without depending on the gateway to change the mount paths.

This PR allows to:

red:reva gonzalhu$ ./cmd/reva/reva ls /oc/einstein/
Documents
red:reva gonzalhu$ ./cmd/reva/reva ls /home/
Documents

@labkode labkode merged commit a531571 into cs3org:master Mar 19, 2020
@butonic butonic changed the title Leave home prefixing to the gateway Leave home prefixing to the storage provider Mar 19, 2020
@butonic butonic deleted the leave-home-prefixing-to-the-gateway branch March 19, 2020 10:29
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.

2 participants