Browse Source

HDFS-3823. QJM: TestQJMWithFaults fails occasionally because of missed setting of HTTP port. Contributed by Todd Lipcon and Aaron T. Myers.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/HDFS-3077@1375323 13f79535-47bb-0310-9956-ffa450edef68
Aaron Myers 13 years ago
parent
commit
643608ea57

+ 2 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt

@@ -26,3 +26,5 @@ HDFS-3799. QJM: handle empty log segments during recovery (todd)
 HDFS-3797. QJM: add segment txid as a parameter to journal() RPC (todd)
 
 HDFS-3800. improvements to QJM fault testing (todd)
+
+HDFS-3823. QJM: TestQJMWithFaults fails occasionally because of missed setting of HTTP port. (todd and atm)

+ 5 - 0
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java

@@ -359,6 +359,11 @@ public class IPCLoggerChannel implements AsyncLogger {
     return executor.submit(new Callable<PrepareRecoveryResponseProto>() {
       @Override
       public PrepareRecoveryResponseProto call() throws IOException {
+        if (httpPort < 0) {
+          // If the HTTP port hasn't been set yet, force an RPC call so we know
+          // what the HTTP port should be.
+          httpPort = getProxy().getJournalState(journalId).getHttpPort();
+        }
         return getProxy().prepareRecovery(createReqInfo(), segmentTxId);
       }
     });