fanhualta commented on a change in pull request #3191:
URL: https://github.com/apache/iotdb/pull/3191#discussion_r639865309
##########
File path:
cluster/src/main/java/org/apache/iotdb/cluster/server/heartbeat/MetaHeartbeatThread.java
##########
@@ -70,4 +70,14 @@ void sendHeartbeatAsync(Node node) {
// erase the sent partition table so it will not be sent in the next
heartbeat
request.unsetPartitionTableBytes();
}
+
+ @Override
+ void startElection() {
+ // if (localMetaMember.getThisNode().metaPort != 9003 &&
+ // localMetaMember.getThisNode().metaPort != 9005) {
+ // return;
+ // }
+ super.startElection();
+ localMetaMember.getAppendLogThreadPool().submit(() ->
localMetaMember.processEmptyContentLog());
Review comment:
A new raft leader needs to have at least one log in its term for
committing logs with older terms. In the meta group, log frequency is very low.
When the leader is changed whiling changing membership, it's necessary to
process an empty log to make sure that cluster expansion operation can be
carried out in time.
I have added notes to explain in codes.
--
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.
For queries about this service, please contact Infrastructure at:
[email protected]