Skip to content

Conversation

@elek
Copy link
Member

@elek elek commented Nov 12, 2020

What changes were proposed in this pull request?

./hadoop-ozone/dev-support/checks/findbugs.sh – which is a short-cut to execute the CI findbugs check locally – couldn't be executed locally after a full build:

./hadoop-ozone/dev-support/checks/findbugs.sh
....
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  3.451 s
[INFO] Finished at: 2020-11-11T11:42:40+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.spotbugs:spotbugs-maven-plugin:3.1.12:spotbugs (spotbugs) on project hadoop-hdds: Execution spotbugs of goal com.github.spotbugs:spotbugs-maven-plugin:3.1.12:spotbugs failed: Java returned: 1 -> [Help 1]
[ERROR] 

The problem:

target/classes directory should be either empty/missing or it should contain java classes to make spotbugs work.

On github it works well as an empty checkout is tested. But locally it's possible that a dummy classpath file is created under hadoop-hdds/target/classes which breaks spotbug local execution.

The solution is easy: execute the classpath descriptor generation only if src/main/java dir exists.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/HDDS-4452

How was this patch tested?

mvn clean install -DskipTests
./hadoop-ozone/dev-support/checks/findbugs.sh

Without the patch it fails as there is a classpath file under hadoop-hdds/target/classes

@elek
Copy link
Member Author

elek commented Nov 12, 2020

The plugin execution is moved to a profile which is acivated automatically by this fragment:

      <activation>
        <file>
          <exists>src/main/java</exists>
        </file>
      </activation>

Which means the profile will be activated only for the projects where java code exists.

@elek elek requested a review from adoroszlai November 12, 2020 09:05
Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Looks like hadoop-ozone/dist/target/ozone-1.1.0-SNAPSHOT/share/ozone/lib is missing after the build. These two steps are executed in the wrong order:

2020-11-12T09:09:33.6324111Z [INFO] --- maven-dependency-plugin:3.1.1:copy-dependencies (copy-jars) @ hadoop-ozone-dist ---
2020-11-12T09:09:33.6368628Z [INFO] Copying kerb-simplekdc-1.0.1.jar to /mnt/ozone/hadoop-ozone/dist/target/ozone-1.1.0-SNAPSHOT/share/ozone/lib/kerb-simplekdc-1.0.1.jar
2020-11-12T09:09:33.6419123Z [INFO] Copying hk2-utils-2.5.0.jar to /mnt/ozone/hadoop-ozone/dist/target/ozone-1.1.0-SNAPSHOT/share/ozone/lib/hk2-utils-2.5.0.jar
...
2020-11-12T09:09:37.3442300Z [INFO] --- exec-maven-plugin:1.3.1:exec (dist) @ hadoop-ozone-dist ---
2020-11-12T09:09:37.6671877Z cp: cannot stat '/mnt/ozone/hadoop-hdds/docs/target/classes/docs': No such file or directory
2020-11-12T09:09:37.6677468Z 
2020-11-12T09:09:37.6691337Z Current directory /mnt/ozone/hadoop-ozone/dist/target
2020-11-12T09:09:37.6692296Z 
2020-11-12T09:09:37.6693293Z $ rm -rf ozone-1.1.0-SNAPSHOT

@elek
Copy link
Member Author

elek commented Nov 13, 2020

Looks like hadoop-ozone/dist/target/ozone-1.1.0-SNAPSHOT/share/ozone/lib is missing after the build. These two steps are executed in the wrong order:

Seems to be a bug which was not visible until now because the classpath file generation.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Now order is OK, but classpath files are generated into the wrong dir, so they are missing from the jars, and then from the share/ozone/classpath dir, too.

elek and others added 2 commits November 16, 2020 09:39
Co-authored-by: Doroszlai, Attila <[email protected]>
Co-authored-by: Doroszlai, Attila <[email protected]>
@elek
Copy link
Member Author

elek commented Nov 16, 2020

Now order is OK, but classpath files are generated into the wrong dir

Oh, that was my first idea to fix it (use different output dir), and it's not supposed to be included in the patch as it would make the modifications more complex. (Added your commits, thanks the suggestions.)

@adoroszlai
Copy link
Contributor

Thanks @elek for updating the patch. Acceptance tests are still red, datanodes fail to start:

datanode_1  | Error: Could not find or load main class org.apache.hadoop.ozone.HddsDatanodeService
datanode_1  | Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.ozone.HddsDatanodeService

because datanode has no classpath file:

bash-4.2$ ozone classpath hadoop-ozone-datanode
/opt/hadoop/bin/../libexec/hadoop-functions.sh: line 2776: /opt/hadoop/share/ozone/classpath/hadoop-ozone-datanode.classpath: No such file or directory
Error: Could not find or load main class org.apache.hadoop.util.Classpath
Caused by: java.lang.ClassNotFoundException: org.apache.hadoop.util.Classpath

as there is only a pom.xml file in hadoop-ozone/datanode.

Copy link
Contributor

@adoroszlai adoroszlai left a comment

Choose a reason for hiding this comment

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

Latest patch LGTM, and we finally have a green build, too.

@adoroszlai adoroszlai merged commit 417082c into apache:master Nov 19, 2020
errose28 added a commit to errose28/ozone that referenced this pull request Nov 24, 2020
* HDDS-3698-upgrade: (46 commits)
  HDDS-4468. Fix Goofys listBucket large than 1000 objects will stuck forever (apache#1595)
  HDDS-4417. Simplify Ozone client code with configuration object -- addendum (apache#1581)
  HDDS-4476. Improve the ZH translation of the HA.md in doc. (apache#1597)
  HDDS-4432. Update Ratis version to latest snapshot. (apache#1586)
  HDDS-4488. Open RocksDB read only when loading containers at Datanode startup (apache#1605)
  HDDS-4478. Large deletedKeyset slows down OM via listStatus. (apache#1598)
  HDDS-4452. findbugs.sh couldn't be executed after a full build (apache#1576)
  HDDS-4427. Avoid ContainerCache in ContainerReader at Datanode startup (apache#1549)
  HDDS-4448. Duplicate refreshPipeline in listStatus (apache#1569)
  HDDS-4450. Cannot run ozone if HADOOP_HOME points to Hadoop install (apache#1572)
  HDDS-4346.Ozone specific Trash Policy (apache#1535)
  HDDS-4426. SCM should create transactions using all blocks received from OM (apache#1561)
  HDDS-4399. Safe mode rule for piplelines should only consider open pipelines. (apache#1526)
  HDDS-4367. Configuration for deletion service intervals should be different for OM, SCM and datanodes (apache#1573)
  HDDS-4462. Add --frozen-lockfile to pnpm install to prevent ozone-recon-web/pnpm-lock.yaml from being updated automatically (apache#1589)
  HDDS-4082. Create ZH translation of HA.md in doc. (apache#1591)
  HDDS-4464. Upgrade httpclient version due to CVE-2020-13956. (apache#1590)
  HDDS-4467. Acceptance test fails due to new Hadoop 3 image (apache#1594)
  HDDS-4466. Update url in .asf.yaml to use TLP project (apache#1592)
  HDDS-4458. Fix Max Transaction ID value in OM. (apache#1585)
  ...
errose28 added a commit to errose28/ozone that referenced this pull request Nov 25, 2020
* HDDS-3698-upgrade: (47 commits)
  HDDS-4468. Fix Goofys listBucket large than 1000 objects will stuck forever (apache#1595)
  HDDS-4417. Simplify Ozone client code with configuration object -- addendum (apache#1581)
  HDDS-4476. Improve the ZH translation of the HA.md in doc. (apache#1597)
  HDDS-4432. Update Ratis version to latest snapshot. (apache#1586)
  HDDS-4488. Open RocksDB read only when loading containers at Datanode startup (apache#1605)
  HDDS-4478. Large deletedKeyset slows down OM via listStatus. (apache#1598)
  HDDS-4452. findbugs.sh couldn't be executed after a full build (apache#1576)
  HDDS-4427. Avoid ContainerCache in ContainerReader at Datanode startup (apache#1549)
  HDDS-4448. Duplicate refreshPipeline in listStatus (apache#1569)
  HDDS-4450. Cannot run ozone if HADOOP_HOME points to Hadoop install (apache#1572)
  HDDS-4346.Ozone specific Trash Policy (apache#1535)
  HDDS-4426. SCM should create transactions using all blocks received from OM (apache#1561)
  HDDS-4399. Safe mode rule for piplelines should only consider open pipelines. (apache#1526)
  HDDS-4367. Configuration for deletion service intervals should be different for OM, SCM and datanodes (apache#1573)
  HDDS-4462. Add --frozen-lockfile to pnpm install to prevent ozone-recon-web/pnpm-lock.yaml from being updated automatically (apache#1589)
  HDDS-4082. Create ZH translation of HA.md in doc. (apache#1591)
  HDDS-4464. Upgrade httpclient version due to CVE-2020-13956. (apache#1590)
  HDDS-4467. Acceptance test fails due to new Hadoop 3 image (apache#1594)
  HDDS-4466. Update url in .asf.yaml to use TLP project (apache#1592)
  HDDS-4458. Fix Max Transaction ID value in OM. (apache#1585)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants