xinglin commented on code in PR #6183:
URL: https://github.com/apache/hadoop/pull/6183#discussion_r1367803434
##########
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java:
##########
@@ -146,6 +149,16 @@ public QuorumJournalManager(Configuration conf,
this.nameServiceId = nameServiceId;
this.loggers = new AsyncLoggerSet(createLoggers(loggerFactory));
+ // Check whether the number of jn maintenance lists is valid
+ String[] skipNodesHostPort = conf.getTrimmedStrings(
+ DFS_JOURNALNODE_MAINTENANCE_NODES_KEY,
DFS_JOURNALNODE_MAINTENANCE_NODES_DEFAULT);
+
+ int quorumThreshold = (this.loggers.size() / 2) + 1;
+ Preconditions.checkArgument(
+ (this.loggers.size() - skipNodesHostPort.length) >= quorumThreshold,
Review Comment:
Instead of creating a QJPFakedTranslatorPB.java, can we just remove these
maintenance JNs from `this.loggers `array? We can also make` quorumThreshold` a
class member to remember the minimum number of available JNs and the minimum
responses we need to commit a write to HDFS.
--
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]