-
Notifications
You must be signed in to change notification settings - Fork 25
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
uDiscovery redesign #242
base: main
Are you sure you want to change the base?
uDiscovery redesign #242
Conversation
The following PR is a reboot of uDiscovery to be able to take all the lessons learned from existing implementations in production. eclipse-uprotocol#137
@@ -1,5 +1,5 @@ | |||
/* | |||
* SPDX-FileCopyrightText: 2023 Contributors to the Eclipse Foundation | |||
* SPDX-FileCopyrightText: 2024 Contributors to the Eclipse Foundation |
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.
this does not need to be changed, given that it is an existing file and unchanged major version ...
// addresses (in URI format), and properties of topics. This API is used by clients (uEs) to be | ||
// about to access the information within the database. Clients talk to their local uDiscovery service |
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.
// addresses (in URI format), and properties of topics. This API is used by clients (uEs) to be | |
// about to access the information within the database. Clients talk to their local uDiscovery service | |
// addresses (in URI format), and properties of topics. This API is used by clients (uEs) to | |
// access the information within the database. Clients talk to their local uDiscovery service |
// The uDiscovery service is used to store information about devices and services namely their | ||
// addresses (in URI format), and properties of topics. This API is used by clients (uEs) to be | ||
// about to access the information within the database. Clients talk to their local uDiscovery service | ||
// who, when is unable to find what it is looking for, queries the central database to find the information. |
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.
// who, when is unable to find what it is looking for, queries the central database to find the information. | |
// which, if unable to find what it is looking for, queries the central database to find the information. |
// addresses (in URI format), and properties of topics. This API is used by clients (uEs) to be | ||
// about to access the information within the database. Clients talk to their local uDiscovery service | ||
// who, when is unable to find what it is looking for, queries the central database to find the information. | ||
// UDiscovery works in heiarchial mode where the local uDiscovery service is the first point of contact |
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.
// UDiscovery works in heiarchial mode where the local uDiscovery service is the first point of contact | |
// The UDiscovery service instances form a hierarchy where the local uDiscovery service is the first point of contact |
rpc LookupUri(LookupUriRequest) returns (LookupUriResponse) { | ||
// Find Services. | ||
// | ||
// Discover t authorities, instances, and versions of services based on the passed URI. |
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.
// Discover t authorities, instances, and versions of services based on the passed URI. | |
// Discover authorities, instances, and versions of services based on the passed URI. |
|
||
[.specitem,oft-sid="dsn~discovery-data-reconciliation-data~1",oft-needs="impl,test"] | ||
-- | ||
* When reconciling data, the data fetched *MUST* be used in lieu of current cached data. |
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.
* When reconciling data, the data fetched *MUST* be used in lieu of current cached data. | |
* When reconciling data, a client *MUST* replace corresponding data in its local cache with the fetched data. |
|
||
[.specitem,oft-sid="dsn~discovery-data-reconciliation-not-found~1",oft-needs="impl,test"] | ||
-- | ||
* If `GetServiceTopics()` returns `UCode.NOT_FOUND` for data we had in our local instance, we *MUST* flush the local cache and then replicate the deletion. we fetch information to reconcile the data If the reconciliation fails, the service *MUST* log the error and continue to use the current cached data. |
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.
I am not sure who is we
in these sentences. Can you rephrase this being (super-)explicit about the roles?
|
||
|
||
=== SetServiceTopics() | ||
The `SetServiceTopics()` API is used by the uDiscovery business logic to add, update, or remove information recursively between the local, domain, and central instances. The API is passed `SetServiceTopicsRequest` containing a repeated list of `UServiceTopicInfo` and `ttl` for when the info will expire. The function returns `SetServiceTopicsResponse` message if the method was successfully processed or it returns `UStatus` containing the error values specified below. |
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.
Where does the information come from originally, i.e. who is registering the info in the local uDiscovery service? Is it the uEntities?
|
||
[.specitem,oft-sid="dsn~discovery-data-reconciliation-not-found~1",oft-needs="impl,test"] | ||
-- | ||
* If `GetServiceTopics()` returns `UCode.NOT_FOUND` for data we had in our local instance, we *MUST* flush the local cache and then replicate the deletion. we fetch information to reconcile the data If the reconciliation fails, the service *MUST* log the error and continue to use the current cached data. |
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.
is this the FindServiceTopics()
operation described above in the client API section?
participant Domain-UDiscovery | ||
participant Central-UDiscovery | ||
|
||
Domain-UDiscovery ->> Local-UDiscovery: GetServiceTopics() |
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.
FindServiceTopics()
?
The following PR is a reboot of uDiscovery to be able to take all the lessons learned from existing implementations in production.
#137