Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Change Id format #172

Closed
akiradeveloper opened this issue Mar 27, 2021 · 3 comments
Closed

Change Id format #172

akiradeveloper opened this issue Mar 27, 2021 · 3 comments
Labels

Comments

@akiradeveloper
Copy link
Owner

Raft node can be identified by its address because it is unique. This is why lol defines Id = Address.

My idea is change this to Id = (Label, Address). This change will make it easy to

  1. Read the log: If address is used as Id in the log, it is difficult to read. If it is shorter like "ND1", it will become easy to identify.
  2. Match different Ids: You may make a Raft cluster on k8s. How to match Pod's label and lol's node? If we use the same label in both layers, matching becomes easy.

Also, as the label is shorter than Address it is much efficient to compare two labels instead of addresses. This will be a bit of optimization.

@akiradeveloper
Copy link
Owner Author

If we do Multi-Raft #131 we should add raft-group-id to the log like

ND1(gid=3): Send RPC to ND5(gid=3)

This should be also considered.

@akiradeveloper
Copy link
Owner Author

akiradeveloper commented Aug 31, 2021

idea:

  • Id will be changed to (Id, Url) where Id is unique u64. (Uniqueness is guaranteed by the admin)
  • In initialization, we set only (Id).
  • In AddServer, we give (Id, Url) so receiver can get binding Id -> Url.
  • In RemoveServer, we give (Id) so receiver can remove binding Id -> Url if exists.
  • The log format wil be change to "ND{Id}> xxxx".

@akiradeveloper
Copy link
Owner Author

Just to avoid deep copy, some library is making such effort. https://sixtyfps.io/releases/0.1.1/docs/rust/sixtyfps/struct.sharedstring

Repository owner locked and limited conversation to collaborators Sep 9, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

1 participant