-
Notifications
You must be signed in to change notification settings - Fork 113
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
move unwrapping and wrapping of paths to the gateway #2016
Conversation
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. |
020861c
to
d30ee97
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, logging in doesn't seem to work for me on this PR. I flushed /var/tmp/ocis
but still nothing, when rebuilding the entire tree it only creates directories
Yes, you're right. I forgot to link the ocis changes that are necessary to be able to test this here... |
e6672c3
to
c5b1fdc
Compare
c5b1fdc
to
592ed27
Compare
fixes #578 |
592ed27
to
c9835c6
Compare
@C0rby this won't work in all scenarios, especially when the registry rules don't necessarily correspond to the actual mount paths. Consider this scenario where we have user spaces sharded across various storage providers, so the registry rules would like Since each of these storage providers has to serve requests corresponding to various users, in the existing scenario, they would be mounted at a path which would have been the common prefix of all paths served by it, in this case, So for a request to list |
You can get around this by storing the mount path along with the rule but that would lead to duplication of config and won't be the best design, so I don't really agree with the decision. What's your use case? |
@ishank011 All you are trying to do with this is shard the storage provider for In your example the three storage providers For more details please check #578 and the ussues linked in it. Storage providers must not be aware of their mount point, or they are tightly coupled with the gateway. This is the first prerequisite of getting rid of the enable home logic that needlessly complicates the development of storage drivers as well as deployments. (The second stop is moving the share folder logic rom the gateway and storage providers into a dedicated share storage provider.) |
@ishank011 @labkode If you need a call, please contact me. This change is vital for our shared understanding of the reva architecture and we need to unblock ich very quickly. |
Basically what @butonic said. We don't want storageproviders to know about their mount points.
An alternative would be: The registry would return all 3 and the gateway forwards the request to them all but only the one configured for /a/... would return data. The other ones would return nothing. |
@butonic to store the mount path for each such rule, we'll need to maintain it for each such rule then
This sounds like a pretty bad design, as there are much more chances of misconfiguration and conflicts here. To get around this, you can only store the address along with the rules and the mount path and IDs in a separate struct, which is essentially what we're doing now.
So the enable home logic is not a prerequisite at all for a storage driver. If it only wants to support global URLs, that is supported as is. We just have that logic in the same driver to avoid code duplication, since after the path translation, it's essentially the same. From this change, we can support both type of requests from the same storage provider, that's an advantage. But you're just moving that logic from the driver to the registry. So your rule would look like
This is making things more complicated for me. At the moment, gateway just calls up the registry to get a list of SPs, the registry does the dirty, complicated work of expanding aliases and matching and we pass the request as it is to the SPs. There's a clear separation of concerns, which will be disturbed by the change.
I completely agree with this. But there again, I don't see the harm in the storage providers trimming the mount paths. |
Sorry, this just sounds really bad latency-wise. We have 9 EOS instances and sending a request to each of them for every operation is not a good idea. |
@ishank011 you are absolutely right: the storage registry is responsible for finding the correct storage provider for a request. But why does the storage provider have to cut off anything from the path segments if the registry already did the 'hard work'? That IMO is a clear violation of concerns. In the global CS3 namespace If we want to shard the user provider we can register them for While the storage registry implementation becomes a little more complex, the storage provider becomes less complex: we can completely drop the mount_path config option for the latter. Any wrap / unwrap logic in a driver will only deal with translating the received path to an internal reference, without having to also cut off a prefix. The gateway is responsible for doing that: it can ask the storage registry about the mount path, cut it off and prepend paths properly in responses. A storage provider should not know it's mount path: #578 that is already a cause for misconfiguration. A static storage provider that uses a toml file to configure routing policies using key value pairs may not be sufficient enough. But changing the static implementation may be a feasible short term solution. In the long run it does IMO not make sense to have a static configuration: the registry should query the storage providers for the storage spaces and their aliases. That would build up a proper routing table... But out of scope for now... |
@ishank011 can you provide an example config for the virtual views? We'd like to cover this with test cases. But it is not clear how to configure the mount path for storageproviders. I assume the storage providers are all configured with mount point Ummm also ... would the two entries in the storage registry have the same id? # mount two storage providers for users
"/users/[a-k]" = {"address" = "localhost:11000"}
"123e4567-e89b-12d3-a456-426655440000" = {"address" = "localhost:11000"}
"/users/[l-z]" = {"address" = "localhost:11001"}
"123e4567-e89b-12d3-a456-426655440000" = {"address" = "localhost:11001"} And how do you shard |
@butonic sharding for home storage providers happens via the aliases feature in the static storage registry. Consider the following registry rules:
Now for a request to Now consider a request to list |
as mentioned in #2215 (comment) the sharestorageprovider brings a new |
c9835c6
to
6313293
Compare
let's not mix the sharestorageprovider with this virtual views. I like the concept, and we could refactor it, but the sharestorageprovider is for sharing only. |
The sharestoreageprovider PR not only introducas a new storage provider. It also has to rewrite the etag calculation logic in the gateway for the root folder, the home folder the share jail and the shares. To implement that properly it has to determine which storage provider is embedded in which. That logic is not complicated, but it does change how the gateway works in a fundamental way. It not only calculates the etag and mtime, but also the size aggregation and the tree. AFAICT the sharestorageprovider PR solves the same problem that was adressed with the virtual views in #2215: aggreating metadata for 'virtual' nodes in the cs3 global namespace that exist along the path segments of configured mount points. |
First things first. We'll write a test to cover this: #2219 |
temporary change to check CI
6313293
to
7f40804
Compare
started an acceptance test in #2219 |
merged in edge as part of #2234 |
We've moved the wrapping and unwrapping of reference paths to the storage gateway so that the storage provider doesn't have to know its mount path.
To test this with ocis you need these changes: owncloud/ocis#2460
Fixes #578 (comment)