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

fix(grpc): throw error on wrong gateway listener #154

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

sskaur
Copy link
Contributor

@sskaur sskaur commented Jun 16, 2023

This PR adds an exception in cases of create/delete_listener where the gateway name is supplied along with traddr but the gateway name does not match the current gateway. Previously, no SPDK call would be made but the listener request would return successfully.

Thanks to @pgerv12 and @SeanP-2023 for finding this issue.

@sskaur sskaur requested a review from trociny June 16, 2023 16:42
Copy link
Contributor

@trociny trociny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it is expected behaviour, intended for multigateway configuration. Note, we skip creating the local spkd listener but we store it in the omap state, so other gateway (with this name) could detect it and create.

I think an improvement that still could be implemented would be to check if the name matches one of the group gateways and throw error if it does not. But currently we don't have such a list of gateways available to check against it.

@sskaur
Copy link
Contributor Author

sskaur commented Jun 16, 2023

I believe it is expected behaviour, intended for multigateway configuration. Note, we skip creating the local spkd listener but we store it in the omap state, so other gateway (with this name) could detect it and create.

I think it's misleading for the grpc to return True when it's possible that no listener will get created. What happens when there's an error with the SPDK call on the other gateway?

@trociny
Copy link
Contributor

trociny commented Jun 18, 2023

I think it's misleading for the grpc to return True when it's possible that no listener will get created. What happens when there's an error with the SPDK call on the other gateway?

So, you propose just to disable a possibility to configure a listener for another gateway? Note, for a not listener case, when a spdk call should be executed on all gateways, if it succeeds on one spdk it does not guarantee it will succeed on all others. Also, after restart, when loading the stored state an spdk call may fail this time.

@caroav
Copy link
Collaborator

caroav commented Aug 24, 2023

@trociny @sskaur do you all agree it is by design? If yes, then can we drop this PR?

@trociny
Copy link
Contributor

trociny commented Aug 24, 2023

AFAIR on one of the weekly meetings it was discussed that we would want this limitation (create/delete listener only with its "local" gateway) to avoid some corner cases. If I understood that correctly then this PR makes sense. @PepperJo can you confirm?

@caroav
Copy link
Collaborator

caroav commented Aug 24, 2023

Yes, after re-reading this PR, I think that this limitation does makes sense. I think that in the future we might want to reconsider it, to allow more ease of use when configuring multi GWs (so user doesn't need to do it separately for each GW), but for now it might be good. @PepperJo agree?

@PepperJo
Copy link

PepperJo commented Sep 5, 2023

@trociny @caroav Yes, I think this PR makes sense. For now I think this is the safest and easiest way to implement a "fix".
@trociny yes, in theory every request can fail but at least in the non-local case we always try to apply locally with SPDK before. That said even if we would test a request on all nodes before applying, it could still happen that at some point later when e.g. a new GW is added or a GW is restartet a config option cannot be applied and the GW fails. This we always have to handle.

@caroav caroav requested a review from baum September 6, 2023 08:34
@caroav
Copy link
Collaborator

caroav commented Sep 6, 2023

@trociny based on latest comment from @PepperJo and based on the upstream discussion yesterday, I think we should merge this change.
@sskaur assuming no further comments from @trociny , will you be able to merge it please.

@baum baum force-pushed the create-listener-wrong-gateway-name branch from b82d572 to f5fd4ac Compare September 6, 2023 13:35
@sskaur sskaur merged commit 639a2f6 into ceph:devel Sep 6, 2023
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants