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

uDiscovery redesign #242

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

stevenhartley
Copy link
Contributor

The following PR is a reboot of uDiscovery to be able to take all the lessons learned from existing implementations in production.

#137

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
Copy link
Contributor

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 ...

Comment on lines +30 to +31
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
* 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.
Copy link
Contributor

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.
Copy link
Contributor

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.
Copy link
Contributor

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()
Copy link
Contributor

Choose a reason for hiding this comment

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

FindServiceTopics()?

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.

2 participants