Pengzna commented on code in PR #14613:
URL: https://github.com/apache/iotdb/pull/14613#discussion_r1903608956
##########
iotdb-core/consensus/src/main/java/org/apache/iotdb/consensus/pipe/PipeConsensus.java:
##########
@@ -132,19 +135,28 @@ public synchronized void start() throws IOException {
throw new IOException(e);
}
+ if (Objects.nonNull(recoverFuture)) {
+ try {
+ recoverFuture.get();
+ } catch (InterruptedException | ExecutionException e) {
+ LOGGER.error("Exception while waiting for recover future completion",
e);
+ }
+ }
+ // only when we recover all consensus group can we launch async backend
checker thread
consensusPipeGuardian.start(
CONSENSUS_PIPE_GUARDIAN_TASK_ID,
this::checkAllConsensusPipe,
config.getPipe().getConsensusPipeGuardJobIntervalInSeconds());
}
- private void initAndRecover() throws IOException {
+ private Future<Void> initAndRecover() throws IOException {
if (!storageDir.exists()) {
// init
if (!storageDir.mkdirs()) {
LOGGER.warn("Unable to create consensus dir at {}", storageDir);
throw new IOException(String.format("Unable to create consensus dir at
%s", storageDir));
}
+ return null;
Review Comment:
good idea, 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]