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

Simultaneous creation of multiple vl3-NSEs #3

Closed
glazychev-art opened this issue Oct 13, 2021 · 4 comments · Fixed by #4
Closed

Simultaneous creation of multiple vl3-NSEs #3

glazychev-art opened this issue Oct 13, 2021 · 4 comments · Fixed by #4

Comments

@glazychev-art
Copy link
Contributor

glazychev-art commented Oct 13, 2021

Description

In the current algorithm, when creating a new endpoint, a request is sent to the master vl3-endpoint, which is already registered. Master is the first endpoint in the list received from registry. And it can be different for different endpoints. This master allocates CIDR for a new NSE from a global prefix.

So, we have following problems:

  1. If we already have 2 endpoints and 2 more new ones appear, we can see CIDR conflict:

Screenshot from 2021-10-13 18-10-20

  1. After solving the first problem, we can see the next one. So we have two concurrent create requests:

Screenshot from 2021-10-13 18-25-13

If this happens at the same time, neither one nor the other will know about each other, because the request to the registry was at the very beginning.

Possible solution

  1. If we will receive list of NSEs from registry in sorted order, we can solve the first problem. All new NSEs will connect to the first of this list.

  2. For the second problem, we can use Watch flag in the registry query.
    Steps:

    • Receive the list of registered NSEs
    • Start watching for new ones
    • Do all procedures - connect to the other endpoints, create a server and registration.
    • Stop watching - now it can serve new clients by itself.
    • Check, if there were any new NSEs while watching? If yes, it means that new endpoints were registered before us and we need to connect to all of them.
    • Check, is master the same? If not, we have no guarantee that the new master received requests from new NSEs that originally belonged to the first master. This is necessary for state consistency and CIDR allocation. So, in this case, we need to close all connections and start over.
@glazychev-art
Copy link
Contributor Author

@edwarnicke @denis-tingaikin @Bolodya1997
Thoughts?

@denis-tingaikin
Copy link
Member

I think to solve this we can simply add registration_time for nse that will be set on registry side.

@edwarnicke
Copy link
Member

edwarnicke commented Oct 31, 2021

I think to solve this we can simply add registration_time for nse that will be set on registry side.

@denis-tingaikin
two questions:

  1. Don't we already have a time in the form of the expiretime?
  2. Would the registration_time move on refresh?

@denis-tingaikin
Copy link
Member

denis-tingaikin commented Nov 1, 2021

Don't we already have a time in the form of the expiretime?

No, expiration_time is updating on refresh.

Would the registration_time move on refresh?

no, it wouldnt. registration_time assigns once by the final registry.

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 a pull request may close this issue.

3 participants