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

Improve reliability of naming service #681

Open
kaetemi opened this issue Mar 6, 2023 · 0 comments
Open

Improve reliability of naming service #681

kaetemi opened this issue Mar 6, 2023 · 0 comments

Comments

@kaetemi
Copy link
Member

kaetemi commented Mar 6, 2023

The naming service currently broadcasts changes as soon as services register and unregister to all other registered services. When connection to the naming service drops temporarily, broadcasts may be missed, and the list of connected services may go out of sync. Similarly, restarts of the NS cause failure.

Upon launch of NS, generate a time + random number pair as a unique identifier of the NS instance. Additionally add a counter starting from 0 to track registration changes.

When a service connects or reconnects, it registers, and sends along any previously known NS identifier and the local change counter in the case of a reconnection.

If the received identifier mismatches, NS sends all registered services plus the new identifier, otherwise, it sends all changes that are more recent than the registration counter.

If a service receives a new NS identifier, this means the NS restarted, and it's registration info will be incomplete. In this case, wait 10 seconds or so before dropping any missing entries as unregistered. Track per registration entry from which NS instance the registration came.

On disconnections and unregistrations, NS needs to track a tombstone entry to update any services that were disconnected during unregistration of another service.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant