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

Handle namespace not found in replication #3557

Merged
merged 4 commits into from
Nov 9, 2022

Conversation

yux0
Copy link
Contributor

@yux0 yux0 commented Nov 4, 2022

What changed?

  1. Handle namespace not found in replication
  2. Change client not found error type

Why?

  1. Drop the replication task if namespace is not found.
  2. Return not found error if the client is not found.

How did you test it?
Existing tests

Potential risks

Is hotfix candidate?
No

@yux0 yux0 requested a review from a team as a code owner November 4, 2022 15:58
@yux0 yux0 requested a review from yycptt November 4, 2022 15:58
if e.currentCluster == targetCluster {
shouldProcessTask = true
break FilterLoop
switch err.(type) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like an existing unit test should fail? Otherwise we probably don't have proper test coverage :)
I stamped this PR but please use your judgement here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let me add one

Copy link
Member

@yycptt yycptt Nov 4, 2022

Choose a reason for hiding this comment

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

To me it looks like embedding the shouldProcessTask logic in the error handling part makes the code a bit hard to understand.

(FYI, currently the only error returned by GetNamespaceByID is namespace not found, but that may change in the future if we make to make the cache read through. so check error type is 👍 )

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Revert to original logic and just handle namespace not found error

@meiliang86
Copy link
Contributor

Also wait for @yycptt to stamp before merge.

@yux0 yux0 merged commit bccf128 into temporalio:master Nov 9, 2022
@yux0 yux0 deleted the replication-ns-not-found branch November 9, 2022 00:29
nagl-temporal pushed a commit that referenced this pull request Nov 9, 2022
* Handle ns not found in replication
nagl-temporal pushed a commit that referenced this pull request Nov 9, 2022
* Handle ns not found in replication
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.

3 participants