Pengzna commented on code in PR #13730:
URL: https://github.com/apache/iotdb/pull/13730#discussion_r1797627114
##########
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/pipeconsensus/PipeConsensusReceiver.java:
##########
@@ -1463,10 +1482,26 @@ private void resetWithNewestRebootTime(int
connectorRebootTimes) {
LOGGER.info(
"PipeConsensus-PipeName-{}: receiver detected an newer rebootTimes,
which indicates the leader has rebooted. receiver will reset all its data.",
consensusPipeName);
+ // since pipe task will resend all data that hasn't synchronized, it's
safe to clear all
+ // events in buffer.
this.reqExecutionOrderBuffer.clear();
this.onSyncedCommitIndex = 0;
// sync the follower's connectorRebootTimes with connector's actual
rebootTimes
this.connectorRebootTimes = connectorRebootTimes;
+ // Note: dataNode reboot will reset pipeTaskRestartTimes
+ this.pipeTaskRestartTimes = 0;
+ this.tsFileWriterPool.handleExit(consensusPipeName);
+ }
+
+ private void resetWithNewestRestartTime(int pipeTaskRestartTimes) {
+ LOGGER.info(
+ "PipeConsensus-PipeName-{}: receiver detected an newer
pipeTaskRestartTimes, which indicates the pipe task has restarted. receiver
will reset all its data.",
+ consensusPipeName);
+ // since pipe task will resend all data that hasn't synchronized, it's
safe to clear all
+ // events in buffer.
+ this.reqExecutionOrderBuffer.clear();
+ this.onSyncedCommitIndex = 0;
+ this.pipeTaskRestartTimes = pipeTaskRestartTimes;
this.tsFileWriterPool.handleExit(consensusPipeName);
Review Comment:
fixed
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]