xinglin commented on code in PR #6183: URL: https://github.com/apache/hadoop/pull/6183#discussion_r1392944771
########## hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/QuorumJournalManager.java: ########## @@ -406,21 +421,39 @@ private void recoverUnclosedSegment(long segmentTxId) throws IOException { logToSync.getStartTxId(), logToSync.getEndTxId())); } - - static List<AsyncLogger> createLoggers(Configuration conf, + + List<AsyncLogger> createLoggers(Configuration conf, + URI uri, + NamespaceInfo nsInfo, + AsyncLogger.Factory factory, + String nameServiceId) + throws IOException { + String[] skipNodesHostPort = conf.getTrimmedStrings( + DFS_JOURNALNODE_MAINTENANCE_NODES_KEY, DFS_JOURNALNODE_MAINTENANCE_NODES_DEFAULT); + return createLoggers(conf, uri, nsInfo, factory, nameServiceId, skipNodesHostPort); + } + + private List<AsyncLogger> createLoggers(Configuration conf, URI uri, NamespaceInfo nsInfo, AsyncLogger.Factory factory, - String nameServiceId) + String nameServiceId, + String[] skipNodesHostPort) throws IOException { List<AsyncLogger> ret = Lists.newArrayList(); List<InetSocketAddress> addrs = Util.getAddressesList(uri, conf); if (addrs.size() % 2 == 0) { LOG.warn("Quorum journal URI '" + uri + "' has an even number " + "of Journal Nodes specified. This is not recommended!"); } + setQuorumJournalCount(addrs.size()); + HostSet skipSet = DFSUtil.getHostSet(skipNodesHostPort); String jid = parseJournalId(uri); for (InetSocketAddress addr : addrs) { + if(skipSet.match(addr)) { + LOG.info("The node {} is a maintenance node and will skip initialization.", addr); Review Comment: nit: "will skip initialization" -> "will be skipped" -- 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: common-issues-unsubscr...@hadoop.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: common-issues-unsubscr...@hadoop.apache.org For additional commands, e-mail: common-issues-h...@hadoop.apache.org