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

Implement node role registration #314

Merged
merged 7 commits into from
Aug 16, 2023
Merged

Implement node role registration #314

merged 7 commits into from
Aug 16, 2023

Conversation

hanahmily
Copy link
Contributor

Register the node role to the metadata registry.

There are two categories of nodes:

  • Stateful nodes: standalone, data nodes, and mixed storage nodes. Their node id has to be passed through a flag "data-node-id", which is unique and sortable between each other.
  • Stateless nodes: Liaison, query nodes. Their node id is generated by the metadata module automatically.

Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
@hanahmily hanahmily added the enhancement New feature or request label Aug 11, 2023
@hanahmily hanahmily added this to the 0.5.0 milestone Aug 11, 2023
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2023

Codecov Report

Merging #314 (23072bc) into main (18e3903) will increase coverage by 0.00%.
The diff coverage is 45.21%.

@@           Coverage Diff            @@
##             main     #314    +/-   ##
========================================
  Coverage   39.74%   39.74%            
========================================
  Files         105      105            
  Lines       11230    11337   +107     
========================================
+ Hits         4463     4506    +43     
- Misses       6320     6373    +53     
- Partials      447      458    +11     
Files Changed Coverage Δ
banyand/metadata/schema/checker.go 33.82% <0.00%> (+0.49%) ⬆️
pkg/run/run.go 0.00% <0.00%> (ø)
test/stress/cases/istio/repo.go 0.00% <0.00%> (ø)
banyand/metadata/schema/node.go 7.14% <11.11%> (+7.14%) ⬆️
banyand/measure/metadata.go 49.19% <50.00%> (ø)
banyand/metadata/server.go 48.93% <50.00%> (-2.18%) ⬇️
banyand/metadata/schema/etcd.go 57.14% <50.98%> (-1.34%) ⬇️
banyand/metadata/client.go 38.46% <54.16%> (+2.62%) ⬆️
banyand/liaison/grpc/server.go 66.86% <63.63%> (-0.01%) ⬇️
banyand/measure/service.go 74.75% <87.50%> (+0.49%) ⬆️
... and 4 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@wu-sheng
Copy link
Member

Does this mean, nodes could be deployed on different roles now? If so, I think the installation doc could be updated.

https://skywalking.apache.org/docs/skywalking-banyandb/next/installation/

One is current standalone mode, the other should start from cluster mode deployment.

Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
@hanahmily
Copy link
Contributor Author

Does this mean, nodes could be deployed on different roles now? If so, I think the installation doc could be updated.

https://skywalking.apache.org/docs/skywalking-banyandb/next/installation/

One is current standalone mode, the other should start from cluster mode deployment.

Previous commits have already drafted the role-based deployment.

https://github.com/apache/skywalking-banyandb/pull/314/files#diff-8b042e3f94ca5c59a7cd990b950aec0073ea84fe811e7b22be51158d7b180d56 amend more introduced in this change.

@wu-sheng
Copy link
Member

I can see the node ID is unique, and considering our query is applying to all data node, why the node IDs are not auto generated?
What is the point to keep manually setting?

@hanahmily
Copy link
Contributor Author

I can see the node ID is unique, and considering our query is applying to all data node, why the node IDs are not auto generated? What is the point to keep manually setting?

It is important for the data node id to be stateful because the shard allocation algorithm depends on it. This means that the node id should be either obtained from a flag or configuration, or generated initially and then stored locally. The first is easier and ensures straightforward maintenance and storage.

@hanahmily
Copy link
Contributor Author

I can see the node ID is unique, and considering our query is applying to all data node, why the node IDs are not auto generated? What is the point to keep manually setting?

It is important for the data node id to be stateful because the shard allocation algorithm depends on it. This means that the node id should be either obtained from a flag or configuration, or generated initially and then stored locally. The first is easier and ensures straightforward maintenance and storage.

Some databases can use the hostname as the node id, Would we prefer this pattern?

@wu-sheng
Copy link
Member

We just had a discussion. The node list should be removed, and no need to add node ID manually.
The data node and shard assignment should be done automatically, as our query solution is there and aggressively querying all nodes.

Further, etcd server is only recommended in a separate deployment. The bundled etcd should be for standalone only officially.

Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
Signed-off-by: Gao Hongtao <hanahmily@gmail.com>
@wu-sheng wu-sheng merged commit eda6bea into main Aug 16, 2023
13 checks passed
@wu-sheng wu-sheng deleted the node-role branch August 16, 2023 14:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] [Cluster] Node roles and discovery
3 participants