Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDDS-1651. Create a http.policy config for Ozone #930

Closed
wants to merge 3 commits into from

Conversation

shwetayakkali
Copy link
Contributor

Change-Id: Ia284f685f6d39a512124e6055537615d325ae96b

Change-Id: Ia284f685f6d39a512124e6055537615d325ae96b
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 35 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
-1 test4tests 0 The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 mvninstall 527 trunk passed
+1 compile 294 trunk passed
+1 checkstyle 90 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 890 branch has no errors when building and testing our client artifacts.
+1 javadoc 188 trunk passed
0 spotbugs 333 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 524 trunk passed
_ Patch Compile Tests _
+1 mvninstall 458 the patch passed
+1 compile 292 the patch passed
+1 javac 292 the patch passed
+1 checkstyle 97 the patch passed
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 1 The patch has no ill-formed XML file.
+1 shadedclient 694 patch has no errors when building and testing our client artifacts.
+1 javadoc 181 the patch passed
+1 findbugs 538 the patch passed
_ Other Tests _
-1 unit 148 hadoop-hdds in the patch failed.
-1 unit 1337 hadoop-ozone in the patch failed.
+1 asflicense 57 The patch does not generate ASF License warnings.
6546
Reason Tests
Failed junit tests hadoop.ozone.container.common.impl.TestHddsDispatcher
hadoop.ozone.client.rpc.TestOzoneClientRetriesOnException
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestWatchForCommit
hadoop.ozone.client.rpc.TestCommitWatcher
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-930/1/artifact/out/Dockerfile
GITHUB PR #930
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux 5a57ea44076b 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 76b94c2
Default Java 1.8.0_212
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/1/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/1/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-930/1/testReport/
Max. process+thread count 5361 (vs. ulimit of 5500)
modules C: hadoop-hdds/common U: hadoop-hdds/common
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-930/1/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@@ -64,6 +64,8 @@
"dfs.container.ratis.ipc";
public static final int DFS_CONTAINER_RATIS_IPC_PORT_DEFAULT = 9858;

public static final String OZONE_HTTP_POLICY = "ozone.http.policy";

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This newly added property should be used during HTTP server start.
That part is missing.

@@ -426,6 +430,20 @@ public static long getUtcTime() {
return Calendar.getInstance(UTC_ZONE).getTimeInMillis();
}

public static Policy getHttpPolicy(Configuration conf) {
String policyStr = conf.get("ozone.http.policy", OzoneConfigKeys.OZONE_HTTP_POLICY);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor NIT: ozone.http.policy -> Use OzoneConfigKeys.OZONE_HTTP_POLICY.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line get() second param value should be a default value for the property.

Change-Id: I047aafc733c936fb82f926bcde489595cf51d928
if (policy == null) {
throw new HadoopIllegalArgumentException("Unrecognized value '" + policyStr + "' for " + "dfs.http.policy");
} else {
conf.set("dfs.http.policy", policy.name());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to set it back?

Copy link
Contributor

@bharatviswa504 bharatviswa504 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank You @shwetayakkali for the contribution.
I have a few comments.

String policyStr = conf.get("ozone.http.policy", OzoneConfigKeys.OZONE_HTTP_POLICY);
if(policyStr == null || policyStr.length() == 0) {
policyStr = conf.get("dfs.http.policy", DFSConfigKeys.DFS_HTTP_POLICY_DEFAULT);
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If HTTP_ONLY is used as the default,
we can conf.get("OzoneConfigKeys.OZONE_HTTP_POLICY", DFSConfigKeys.DFS_HTTP_POLICY_DEFAULT);
Then we don't need checks of null, and we can make this logic simple.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 36 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
0 mvndep 63 Maven dependency ordering for branch
+1 mvninstall 552 trunk passed
+1 compile 311 trunk passed
+1 checkstyle 80 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 857 branch has no errors when building and testing our client artifacts.
+1 javadoc 181 trunk passed
0 spotbugs 350 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 536 trunk passed
_ Patch Compile Tests _
0 mvndep 30 Maven dependency ordering for patch
+1 mvninstall 473 the patch passed
+1 compile 302 the patch passed
+1 javac 302 the patch passed
-0 checkstyle 38 hadoop-hdds: The patch generated 3 new + 0 unchanged - 0 fixed = 3 total (was 0)
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 1 The patch has no ill-formed XML file.
+1 shadedclient 641 patch has no errors when building and testing our client artifacts.
+1 javadoc 180 the patch passed
+1 findbugs 545 the patch passed
_ Other Tests _
-1 unit 114 hadoop-hdds in the patch failed.
-1 unit 1267 hadoop-ozone in the patch failed.
+1 asflicense 58 The patch does not generate ASF License warnings.
6506
Reason Tests
Failed junit tests hadoop.hdds.server.TestBaseHttpServer
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.TestMiniChaosOzoneCluster
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-930/2/artifact/out/Dockerfile
GITHUB PR #930
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux 31c208148507 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 4f45529
Default Java 1.8.0_212
checkstyle https://builds.apache.org/job/hadoop-multibranch/job/PR-930/2/artifact/out/diff-checkstyle-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/2/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/2/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-930/2/testReport/
Max. process+thread count 4866 (vs. ulimit of 5500)
modules C: hadoop-hdds/common hadoop-hdds/framework hadoop-ozone/ozone-manager U: .
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-930/2/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 92 Docker mode activated.
_ Prechecks _
+1 dupname 1 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
0 mvndep 73 Maven dependency ordering for branch
+1 mvninstall 579 trunk passed
+1 compile 353 trunk passed
+1 checkstyle 98 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 1084 branch has no errors when building and testing our client artifacts.
+1 javadoc 192 trunk passed
0 spotbugs 395 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 629 trunk passed
_ Patch Compile Tests _
0 mvndep 31 Maven dependency ordering for patch
+1 mvninstall 574 the patch passed
+1 compile 348 the patch passed
+1 javac 348 the patch passed
-0 checkstyle 50 hadoop-hdds: The patch generated 3 new + 0 unchanged - 0 fixed = 3 total (was 0)
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 1 The patch has no ill-formed XML file.
+1 shadedclient 843 patch has no errors when building and testing our client artifacts.
+1 javadoc 174 the patch passed
+1 findbugs 573 the patch passed
_ Other Tests _
-1 unit 137 hadoop-hdds in the patch failed.
-1 unit 1315 hadoop-ozone in the patch failed.
+1 asflicense 50 The patch does not generate ASF License warnings.
7455
Reason Tests
Failed junit tests hadoop.hdds.server.TestBaseHttpServer
hadoop.ozone.client.rpc.TestBCSID
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
Subsystem Report/Notes
Docker Client=18.09.5 Server=18.09.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-930/3/artifact/out/Dockerfile
GITHUB PR #930
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux 6a08fa8fe25d 4.15.0-48-generic #51-Ubuntu SMP Wed Apr 3 08:28:49 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 4f45529
Default Java 1.8.0_212
checkstyle https://builds.apache.org/job/hadoop-multibranch/job/PR-930/3/artifact/out/diff-checkstyle-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/3/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/3/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-930/3/testReport/
Max. process+thread count 4424 (vs. ulimit of 5500)
modules C: hadoop-hdds/common hadoop-hdds/framework hadoop-ozone/ozone-manager U: .
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-930/3/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@bharatviswa504
Copy link
Contributor

One more comment, we need to change the code in OzoneManagerSnapShotProvider class, to use this newly added method.

Line 89: this.httpPolicy = DFSUtil.getHttpPolicy(conf);

Change-Id: I23b1ddc619488bb290be9136a18ec5e2aab7dd77
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
0 reexec 519 Docker mode activated.
_ Prechecks _
+1 dupname 0 No case conflicting files found.
+1 @author 0 The patch does not contain any @author tags.
+1 test4tests 0 The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
0 mvndep 67 Maven dependency ordering for branch
+1 mvninstall 498 trunk passed
+1 compile 263 trunk passed
+1 checkstyle 73 trunk passed
+1 mvnsite 0 trunk passed
+1 shadedclient 863 branch has no errors when building and testing our client artifacts.
+1 javadoc 164 trunk passed
0 spotbugs 313 Used deprecated FindBugs config; considering switching to SpotBugs.
+1 findbugs 505 trunk passed
_ Patch Compile Tests _
0 mvndep 34 Maven dependency ordering for patch
+1 mvninstall 439 the patch passed
+1 compile 273 the patch passed
+1 javac 273 the patch passed
-0 checkstyle 39 hadoop-hdds: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 mvnsite 0 the patch passed
+1 whitespace 0 The patch has no whitespace issues.
+1 xml 1 The patch has no ill-formed XML file.
+1 shadedclient 682 patch has no errors when building and testing our client artifacts.
+1 javadoc 161 the patch passed
+1 findbugs 524 the patch passed
_ Other Tests _
-1 unit 148 hadoop-hdds in the patch failed.
-1 unit 1092 hadoop-ozone in the patch failed.
+1 asflicense 50 The patch does not generate ASF License warnings.
6616
Reason Tests
Failed junit tests hadoop.ozone.container.common.impl.TestHddsDispatcher
hadoop.ozone.client.rpc.TestFailureHandlingByClient
hadoop.ozone.client.rpc.TestOzoneRpcClient
hadoop.ozone.client.rpc.TestSecureOzoneRpcClient
hadoop.ozone.client.rpc.TestWatchForCommit
hadoop.ozone.client.rpc.TestOzoneAtRestEncryption
hadoop.ozone.client.rpc.TestOzoneRpcClientWithRatis
Subsystem Report/Notes
Docker Client=17.05.0-ce Server=17.05.0-ce base: https://builds.apache.org/job/hadoop-multibranch/job/PR-930/4/artifact/out/Dockerfile
GITHUB PR #930
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle xml
uname Linux a041c46a08f4 4.4.0-138-generic #164-Ubuntu SMP Tue Oct 2 17:16:02 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 37bd5bb
Default Java 1.8.0_212
checkstyle https://builds.apache.org/job/hadoop-multibranch/job/PR-930/4/artifact/out/diff-checkstyle-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/4/artifact/out/patch-unit-hadoop-hdds.txt
unit https://builds.apache.org/job/hadoop-multibranch/job/PR-930/4/artifact/out/patch-unit-hadoop-ozone.txt
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-930/4/testReport/
Max. process+thread count 5006 (vs. ulimit of 5500)
modules C: hadoop-hdds/common hadoop-hdds/framework hadoop-ozone/ozone-manager U: .
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-930/4/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@bharatviswa504
Copy link
Contributor

bharatviswa504 commented Jun 25, 2019

Hi,
I have a question:
What is the reason to create a new http policy for ozone? Because when https is enabled, some of the additional config like key store location we still use dfs.https.server.keystore.resource.

I feel ozone can also re-use the hdfs config. In this way, we don't miss the code changes where HTTP policy is being used, like OzoneManagerSnapShotProvider which uses still DFSUtils.getHttpPolicy.

And also we use to create HttpServer2.Builder builder with below code. That again uses dfs.http.policy. So, this is the reason we need to set ozone.http.policy to dfs.http.policy to make it work. So, I feel to avoid all these, we can use dfs.http.policy as before. Let me know your thoughts on this.

      builder = DFSUtil.httpServerTemplateForNNAndJN(conf, this.httpAddress,
          this.httpsAddress, name, getSpnegoPrincipal(), getKeytabFile());

@@ -31,6 +31,7 @@
import java.util.Optional;
import java.util.TimeZone;

import org.apache.hadoop.HadoopIllegalArgumentException;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: Unused import.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for using dfs.http..policy to reduce redundant config knobs.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank You @eyanghwx for review.
I also feel the same. Can we close this as won't Fix?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank You @eyanghwx for the confirmation.
I will close this as Won't fix.

@bharatviswa504
Copy link
Contributor

Thank You @shwetayakkali for the contribution.
Closing this based on the above discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants