-
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 #219
uDiscovery Redesign #219
Conversation
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.
Looks good to me.
My only doubts are regarding the reconciliation process.
I don't have a clear understanding after reading the API design.
I think some further explanation would help someone who is reading this for the first time.
|
||
Domain-UDiscovery ->> Local-UDiscovery: GetServiceTopics() | ||
Local-UDiscovery -->> Domain-UDiscovery: GetServiceTopicsResponse | ||
Domain-UDiscovery ->> Domain-UDiscovery: ReconcileData() |
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 understand the ReconcileData function will re-sync the DB.
What do you compare against? How do you test for equality?
In this example, will it just re-sync the topics i.e. (partial sync)?
I'm thinking that you would need a snapshot or hash of the entire DB to guarantee synchronization.
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 wonder if that is implementation details for a given implementation or something that we need to specify here. @kz9nyy Could we elaborate on the reconcileData() functionality in a subsequent PR?
up-l3/udiscovery/v3/client.adoc
Outdated
|
||
== Client Facing APIs | ||
|
||
The client facing APIs of uDiscovery provide the means for uEs to discover services (where they are located, versions, etc...), and topic metadata that a service produces (method id and permissions, publish topic message formats, etc...). The API is declared in the the xref:../../../up-core-api/uprotocol/core/udiscovery/v3/udiscovery.proto[uDiscovery service proto]. |
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.
You may want to consider introducing a document attribute for the reference to the proto file. This will make it easier to maintain the link (if it needs to change) and will save you a lot of typing :-)
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 saw that in another change you did, I'll consider it for the future edits
up-l3/udiscovery/v3/service.adoc
Outdated
- *ue_id:* The unique identifier of the service (both the instance and service ID portions). | ||
- *authority_name:* The name of the authority that hosts the service. | ||
- *ue_version_major:* The version of the service. | ||
- *resource_id:* The resource ID (value of 0 us used to indicate the default ID for the 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.
what is the default ID for a 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.
Resource_id of 0 means the default topic for responses and notifications to be sent to
up-l3/udiscovery/v3/service.adoc
Outdated
|
||
== Client APIs | ||
|
||
The following section we will elaborate on the service-side requirements for the uDiscover service when it serves the client facing APIs defined in the xref:../../../up-core-api/uprotocol/core/udiscovery/v3/udiscovery.proto[udiscovery.proto]. |
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.
you might want to introduce a document attribute for the link to the proto ...
// 3. code.INVALID_ARGUMENT: The passed UUri is invalid | ||
// 4. code.PERMISSION_DENIED: The caller does not have permission to perform the query | ||
rpc LookupUri(LookupUriRequest) returns (LookupUriResponse) { | ||
// Find Services. |
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.
FMPOV all of this documentation should go into the specification document ...
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.
@sophokles73 I changed this now so please re-review
// How long the topic metadata is valid for in seconds. | ||
// If the metadata is older than this value, the client should re-fetch the metadata. | ||
// If the field is missed or the value is 0, the client should assume the metadata is valid forever. | ||
optional uint32 ttl = 3; |
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.
ServiceTopicInfo already includes ttl, why this one is needed?
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.
Correct, I will remove it now
// If the metadata has expired, the UDiscovery service that received this data must flush the ServiceTopic info. | ||
// If the field is missed, the ServiceTopicInfo is valid forever. | ||
// If the field is set to 0, the ServiceTopicInfo should be removed from the database immediately. | ||
optional uint32 ttl = 2; |
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.
Removal is not obvious when ttl is used to request that. Default value 0 by generated code is returned if field is not set.
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.
@mishap4 , Because the field is optional, there is a difference from default and not present, this means we can treat them differntly.
@@ -42,43 +42,22 @@ service uDiscovery { | |||
|
|||
// Find Services. | |||
// | |||
// The API is used to find the authority(ies), instance(s), and version(s) of services based on the passed URI. | |||
// Discovery the authority(ies) (where), instance(s), and version(s) 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.
Did you mean
Discovery of the authorities ...
?
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.
Meant to be one or many authories but I guess I can just make it all plural.
up-l3/udiscovery/v3/client.adoc
Outdated
-- | ||
* *MUST* return a `UCode.INVALID_ARGUMENT` if: | ||
* The lower 16 bits of `ue_id` (_service ID_) is missing. |
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.
how can the lower 16 bits be missing, i.e. how would a corresponding URI look like? Or did you mean: if the lower 16 bits are 0x0000?
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.
hum... I guess you might want to find out version for the uSubscription service so this requirement needs to be removed then all together.
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.
Can you add a corresponding entry to the list of examples? I still haven't understood the use case ...
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.
Pushing a change now
up-l3/udiscovery/v3/client.adoc
Outdated
|
||
==== Example Use Cases | ||
|
||
Below are example use cases for the API when passed certain URIs (shown in string form) along with the |
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 sentence seems to be missing an ending
@@ -42,43 +42,22 @@ service uDiscovery { | |||
|
|||
// Find Services. | |||
// | |||
// The API is used to find the authority(ies), instance(s), and version(s) of services based on the passed URI. | |||
// Discovery the authority(ies) (where), instance(s), and version(s) 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.
Meant to be one or many authories but I guess I can just make it all plural.
// How long the topic metadata is valid for in seconds. | ||
// If the metadata is older than this value, the client should re-fetch the metadata. | ||
// If the field is missed or the value is 0, the client should assume the metadata is valid forever. | ||
optional uint32 ttl = 3; |
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.
Correct, I will remove it now
up-l3/udiscovery/v3/client.adoc
Outdated
-- | ||
* *MUST* return a `UCode.INVALID_ARGUMENT` if: | ||
* The lower 16 bits of `ue_id` (_service ID_) is missing. |
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.
hum... I guess you might want to find out version for the uSubscription service so this requirement needs to be removed then all together.
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.
LGTM
@stevenhartley can you rebase this PR? |
The following is the redesign of uDiscovery service based on the various lessons learned from deploying uDiscovery in production and valuable feedback from developers. uDiscovery is no longer a dumping ground for all forms of information but instead only stores service discovery information (service location, version, and service topic metadata). Co-authored-by: Christian Alexander <christian.alexander101@gmail.com> Co-authored-by: Kai Hudalla <sophokles.kh@gmail.com> #137
The following is the redesign of uDiscovery service based on the various lessons learned from deploying uDiscovery in production and valuable feedback from developers. uDiscovery is no longer a dumping ground for all kinds of information but instead only stores service discovery information (service location, version, and service topic metadata).
#137