From 643608ea576f6afc8d940a0d910d0ea69a2dd77c Mon Sep 17 00:00:00 2001 From: Aaron Myers Date: Mon, 20 Aug 2012 23:44:14 +0000 Subject: [PATCH] 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 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt | 2 ++ .../apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt index 16ccf997fb..d2cf71efb6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt +++ b/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) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java index 56f494f186..9d19ec173b 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/client/IPCLoggerChannel.java @@ -359,6 +359,11 @@ public ListenableFuture prepareRecovery( return executor.submit(new Callable() { @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); } });