You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@iotdb.apache.org by "liyuheng55555 (via GitHub)" <gi...@apache.org> on 2025/02/13 15:17:56 UTC
Re: [PR] 【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 [iotdb]
liyuheng55555 commented on code in PR #14814:
URL: https://github.com/apache/iotdb/pull/14814#discussion_r1954712987
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/iot/IoTConsensus.java:
##########
@@ -174,7 +175,7 @@ private void initAndRecover() throws IOException {
new IoTConsensusServerImpl(
path.toString(),
new Peer(consensusGroupId, thisNodeId, thisNode),
- new ArrayList<>(),
+ new TreeSet<>(),
Review Comment:
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<Peer> with a consistent order (for an interface), which I believe is better than the unordered HashSet.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: reviews-unsubscribe@iotdb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org