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

CDAP-21027 : upgrading hadoop version to 3.3.6 #15648

Merged
merged 1 commit into from
Jul 25, 2024

Conversation

sahusanket
Copy link
Contributor

@sahusanket sahusanket commented May 13, 2024

As a part of resolving vulnerabilities we are upgrading the hadoop version.

Main upgrade

hadoop 2.6.5 --> 3.3.6

other affected upgrades :

jetty 8.1.15.v20140411 --> 9.4.51.v20230217
mockito 1.10.19 --> 3.9.0
powermock 1.7.4 --> 2.0.9
avro 1.8.2 --> 1.11.0

Tested pipelines with some core plugins, avro file , joins, wrangler , GCS, big query.

  1. Sandbox testing
  2. Image testing on PROD

Tested with draft branches :

@sahusanket sahusanket added the build Triggers github actions build label May 13, 2024
@sahusanket sahusanket force-pushed the CDAP-21027_hadoop_upgrade branch 2 times, most recently from 1f7fd86 to 716f859 Compare May 16, 2024 08:37
@sahusanket sahusanket force-pushed the CDAP-21027_hadoop_upgrade branch 6 times, most recently from c3bc42e to 7448b11 Compare June 24, 2024 10:46
@sahusanket sahusanket changed the title Cdap 21027 hadoop upgrade CDAP-21027 : upgrading hadoop version to 3.3.6 Jul 22, 2024
@sahusanket sahusanket marked this pull request as ready for review July 22, 2024 14:47
@@ -172,6 +172,7 @@ public void apply() throws IOException {
// run the partition writer m/r with this output partition time
Map<String, String> arguments = new HashMap<>();
arguments.put(OUTPUT_PARTITION_KEY, Long.toString(now));
arguments.put("system.mapreduce.mapreduce.fileoutputcommitter.algorithm.version", "1");
Copy link
Member

Choose a reason for hiding this comment

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

Add a comment here explaining why this property is set. We also need to document this in case a customer needs to overwrite this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Regarding documentation, I can add to release notes, but this change is only applicable to map reduce programs, which is already deprecated. I don't think we use map reduce outside of tests anymore.

For spark, we already support custom arguments

@sahusanket sahusanket force-pushed the CDAP-21027_hadoop_upgrade branch 2 times, most recently from 1f69734 to dedf0dd Compare July 23, 2024 13:20
cdap-app-fabric/pom.xml Show resolved Hide resolved
cdap-formats/pom.xml Show resolved Hide resolved
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<scope>compile</scope>
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 include it here and then exclude with HadoopClassExcluder? Can we just exclude it from the app file altogether?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is was an experiment to completely remove jackson from CDAP or making it provided.
Removing jackson completely causes class not found issues inside app-fabric while provisioning.
Adding this helped resolve the issue.

I think this is no longer required, will remove n test it.
[Edit] : Tested on image, works fine after removing.

regarding "exclude it from the app file " will discuss with you offline.

@@ -89,22 +89,32 @@
<dependency>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-server</artifactId>
<version>${jetty9.version}</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's same in parent pom. Why do we need to override?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removing it.

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version>
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 override? Parent pom has <servlet.api.version>3.0.1</servlet.api.version>. Can we just change it to 3.1.0 over there?

@@ -172,6 +182,12 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

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

We should use jcl-over-slf4j instead of commons-logging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When running UGIProviderTest ,
it fails with

java.lang.NoClassDefFoundError: org/apache/commons/logging/impl/Log4JLogger
	at org.apache.hadoop.hdfs.server.common.MetricsLoggerTask.makeMetricsLoggerAsync(MetricsLoggerTask.java:154)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.startMetricsLogger(NameNode.java:852)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.initialize(NameNode.java:805)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:1033)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.<init>(NameNode.java:1008)
	at org.apache.hadoop.hdfs.server.namenode.NameNode.createNameNode(NameNode.java:1782)
	at org.apache.hadoop.hdfs.MiniDFSCluster.createNameNode(MiniDFSCluster.java:1390)
	```
	
	Seems like `MiniDFSCluster` requires this lib. 

Copy link
Contributor

Choose a reason for hiding this comment

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

Please address this comment

Copy link
Contributor

Choose a reason for hiding this comment

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

I would try to disable metrics by setting dfs.namenode.metrics.logger.period.seconds to -1. This code is weird and refers log4j. Also the commons-logging would collide with jcl-over-slf4j, so logging will be all over the place

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks, this worked.

@sahusanket sahusanket requested a review from tivv July 24, 2024 19:41
@sahusanket sahusanket force-pushed the CDAP-21027_hadoop_upgrade branch 2 times, most recently from 005cb34 to fa0b321 Compare July 24, 2024 21:23
@sahusanket sahusanket merged commit a044e88 into develop Jul 25, 2024
12 of 13 checks passed
@sahusanket sahusanket deleted the CDAP-21027_hadoop_upgrade branch July 25, 2024 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Triggers github actions build
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants