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

Return empty topology response when not known #9360

Merged
merged 1 commit into from
May 11, 2022

Conversation

remcowesterhoud
Copy link
Contributor

@remcowesterhoud remcowesterhoud commented May 11, 2022

Description

The topology is a way to view the cluster from the gateway's point of view. Returning UNAVAILABLE hides this and makes it hard to distinguish between a call where the gateway is unavailable and where the topology is simply not known. By returning an empty topology we can differentiate between an unavailable gateway and a not known topology.

Related issues

closes #9096

Definition of Done

Not all items need to be done depending on the issue and the pull request.

Code changes:

  • The changes are backwards compatibility with previous versions
  • If it fixes a bug then PRs are created to backport the fix to the last two minor versions. You can trigger a backport by assigning labels (e.g. backport stable/1.3) to the PR, in case that fails you need to create backports manually.

Testing:

  • There are unit/integration tests that verify all acceptance criterias of the issue
  • New tests are written to ensure backwards compatibility with further versions
  • The behavior is tested manually
  • The change has been verified by a QA run
  • The impact of the changes is verified by a benchmark

Documentation:

  • The documentation is updated (e.g. BPMN reference, configuration, examples, get-started guides, etc.)
  • New content is added to the release announcement
  • If the PR changes how BPMN processes are validated (e.g. support new BPMN element) then the Camunda modeling team should be informed to adjust the BPMN linting.

Please refer to our review guidelines.

@remcowesterhoud
Copy link
Contributor Author

@npepinpe Would you mind reviewing this one?

I was wondering how we would define an "empty" topology. When the topology is not known we don't have information we could give. Because of this I've decided to set the cluster size, partition count and replication to factor to -1 as an indication that the gateway doesn't know what the actual configured values are.

❓ In theory this is a breaking change. Where we used to throw an error we are now returning an empty response. Users could be making this call and checking for the error to perform some different logic. How should we deal with this?

@npepinpe
Copy link
Member

Let's indicate that it's a breaking change in the release notes, but I don't think it's a loss for most users. They should still have to handle the case where it's empty for completion, I think, and as you mentioned, they couldn't distinguish before between a real unavailable and just no topology.

Copy link
Member

@npepinpe npepinpe left a comment

Choose a reason for hiding this comment

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

🚀

Thanks! Please address the comments, but I doubt we'll need another review so I'm pre-emptively approving.

The topology is a way to view the cluster from the gateway's point of view. Returning UNAVAILABLE hides this and makes it hard to distinguish between a call where the gateway is unavailable and where the topology is simply not known. By returning an empty topology we can differentiate between an unavailable gateway and a not known topology.
@remcowesterhoud
Copy link
Contributor Author

bors merge

@zeebe-bors-camunda
Copy link
Contributor

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.

Return an empty topology when no there is no known topology
2 participants