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

【remember to add Hu and Peng to co-arthor and delete this bracket before merge】IoTConsensus and IoTConsensusV2 no longer stores the peer list locally on the DataNode #14814

Conversation

liyuheng55555
Copy link
Collaborator

@liyuheng55555 liyuheng55555 commented Feb 11, 2025

The new resetPeerList interface is super powerful.

Now, IoTConsensus member management can be fully handled by ConfigNode, and DataNode can simply obtain the peer list from ConfigNode during startup (through resetPeerList interface).

Copy link
Collaborator

@HxpSerein HxpSerein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@liyuheng55555 liyuheng55555 changed the title IoTConsensus no longer stores the peer list locally on the DataNode 【remember to add Hu to co-arthor and delete this bracket before merge】IoTConsensus no longer stores the peer list locally on the DataNode Feb 13, 2025
Copy link
Collaborator

@Pengzna Pengzna left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Complete IoTV2 part

@@ -174,7 +175,7 @@ private void initAndRecover() throws IOException {
new IoTConsensusServerImpl(
path.toString(),
new Peer(consensusGroupId, thisNodeId, thisNode),
new ArrayList<>(),
new TreeSet<>(),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why use treeset?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Previously, duplicates were removed during configuration persistence. Now that the persistence code is gone, a set is used to keep this logic.

TreeSet is used to return a List with a consistent order (for an interface), which I believe is better than the unordered HashSet.

@liyuheng55555 liyuheng55555 changed the title 【remember to add Hu to co-arthor and delete this bracket before merge】IoTConsensus no longer stores the peer list locally on the DataNode 【remember to add Hu and Peng to co-arthor and delete this bracket before merge】IoTConsensus no longer stores the peer list locally on the DataNode Feb 13, 2025
@liyuheng55555 liyuheng55555 changed the title 【remember to add Hu and Peng to co-arthor and delete this bracket before merge】IoTConsensus no longer stores the peer list locally on the DataNode 【remember to add Hu and Peng to co-arthor and delete this bracket before merge】IoTConsensus and IoTConsensusV2 no longer stores the peer list locally on the DataNode Feb 13, 2025
Copy link
Contributor

@OneSizeFitsQuorum OneSizeFitsQuorum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM~
Really Awesome work!

@OneSizeFitsQuorum OneSizeFitsQuorum merged commit 4bd2f25 into apache:master Feb 17, 2025
50 checks passed
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 this pull request may close these issues.

4 participants