aswinmprabhu commented on code in PR #6925:
URL: https://github.com/apache/hadoop/pull/6925#discussion_r1680426413
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/JournalNodeSyncer.java:
##########
@@ -187,7 +198,15 @@ private void startSyncJournalsDaemon() {
while(shouldSync) {
try {
if (!journal.isFormatted()) {
- LOG.warn("Journal cannot sync. Not formatted.");
+ LOG.warn("Journal cannot sync. Not formatted. Trying to format
with the syncer");
+ formatWithSyncer();
+ if (journal.isFormatted() && !createEditsSyncDir()) {
+ LOG.error("Failed to create directory for downloading log " +
+ "segments: {}. Stopping Journal Node Sync.",
+ journal.getStorage().getEditsSyncDir());
+ return;
+ }
+ continue;
Review Comment:
The endless loop already exists. If the JN is unformatted, it will throw an
exception in a loop every time the syncer tries to sync from other JNs.
`tryFormatting` doesn't add anything extra to the loop. But if it is set, the
formatting could happen.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]