Skip to content

Conversation

@yim-lee
Copy link
Member

@yim-lee yim-lee commented Jun 10, 2022

Resolves #948

Depends on #969. Please look at 8f46d04 only.

@yim-lee yim-lee changed the title [WIP] Add API to 'await joining cluster' Add API to 'await joining cluster' Jun 14, 2022
@yim-lee yim-lee requested a review from ktoso June 14, 2022 02:00
guard let foundMember = membership.uniqueMember(node) else {
throw Cluster.MembershipError.notFound(node, in: membership)
}

Copy link
Member

Choose a reason for hiding this comment

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

Oh sorry to bother you but I thought of another case...

If a node was removed BEFORE, we'll have a tombstone for it inside the private var _associationTombstones: [UniqueNode: Association.Tombstone] protected by _associationsLock. If it is in there, we should return that the member was .removed

You can "make up" a member for a removed node by creating a Member( from the unique node and put .unreachable and .removed in there 👍

This could be in a separate PR 👍

Copy link
Member Author

Choose a reason for hiding this comment

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

amended 5178fa4

Copy link
Member

Choose a reason for hiding this comment

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

Looking good!

\(lastErrorMessage)
"""
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Looks good but Perhaps must be wrapped in "MembershipError(\(self), details: <the nice strings>")? Otherwise might be weird not seeing what type the error was?

Copy link
Member Author

Choose a reason for hiding this comment

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

amended bce275d

Copy link
Member

@ktoso ktoso left a comment

Choose a reason for hiding this comment

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

LGTM!

Minor potential addition to handle removed nodes better

@ktoso
Copy link
Member

ktoso commented Jun 14, 2022

Will amend the wording, look at the failure and merge, thank you! :)

@ktoso ktoso merged commit 6f6bdc4 into apple:main Jun 14, 2022
@yim-lee yim-lee deleted the iss948 branch June 14, 2022 19:12
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.

Add an API to "await joining the cluster"

2 participants