From 99a40ddacf19f7ae9d89cdc4778384ffd6a0e394 Mon Sep 17 00:00:00 2001 From: Josh Elser Date: Fri, 1 May 2020 18:18:06 -0400 Subject: [PATCH] HBASE-24280 Skip explicit hadoop3 profile activation on master On 2.x branches, we need to explicitly activate profiles for H3. On master, all H2 support is dropped which means no special profiles are required for H3 (though, there is still a profile there to encapsulate H3 logic). We need to make sure that the yetus invocation can correctly pass down any profile information into the personality, so we activate the exact profiles we want. Closes #1609 Co-authored-by: Istvan Toth Signed-off-by: stack --- dev-support/hbase-personality.sh | 20 ++++++++++++++----- dev-support/hbase_nightly_yetus.sh | 6 +++++- dev-support/jenkins_precommit_github_yetus.sh | 6 +++++- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/dev-support/hbase-personality.sh b/dev-support/hbase-personality.sh index 735e133a19e..8ed1a83f252 100755 --- a/dev-support/hbase-personality.sh +++ b/dev-support/hbase-personality.sh @@ -145,8 +145,11 @@ function personality_modules extra="${extra} -Dhttps.protocols=TLSv1.2" fi - if [[ -n "${HADOOP_PROFILE}" ]]; then - extra="${extra} -Phadoop-${HADOOP_PROFILE}" + # If we have HADOOP_PROFILE specified and we're on branch-2.x, pass along + # the hadoop.profile system property. Ensures that Hadoop2 and Hadoop3 + # logic is not both activated within Maven. + if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" =~ branch-2* ]] ; then + extra="${extra} -Dhadoop.profile=${HADOOP_PROFILE}" fi # BUILDMODE value is 'full' when there is no patch to be tested, and we are running checks on @@ -458,8 +461,11 @@ function shadedjars_rebuild '-pl' 'hbase-shaded/hbase-shaded-check-invariants' '-am' '-Dtest=NoUnitTests' '-DHBasePatchProcess' '-Prelease' '-Dmaven.javadoc.skip=true' '-Dcheckstyle.skip=true' '-Dspotbugs.skip=true') - if [[ -n "${HADOOP_PROFILE}" ]]; then - maven_args+=("-Phadoop-${HADOOP_PROFILE}") + # If we have HADOOP_PROFILE specified and we're on branch-2.x, pass along + # the hadoop.profile system property. Ensures that Hadoop2 and Hadoop3 + # logic is not both activated within Maven. + if [[ -n "${HADOOP_PROFILE}" ]] && [[ "${PATCH_BRANCH}" =~ branch-2* ]] ; then + maven_args+=("-Dhadoop.profile=${HADOOP_PROFILE}") fi # disabled because "maven_executor" needs to return both command and args @@ -636,6 +642,10 @@ function hadoopcheck_rebuild fi done + hadoop_profile="" + if [[ "${PATCH_BRANCH}" =~ branch-2* ]]; then + hadoop_profile="-Dhadoop.profile=3.0" + fi for hadoopver in ${hbase_hadoop3_versions}; do logfile="${PATCH_DIR}/patch-javac-${hadoopver}.txt" # disabled because "maven_executor" needs to return both command and args @@ -644,7 +654,7 @@ function hadoopcheck_rebuild $(maven_executor) clean install \ -DskipTests -DHBasePatchProcess \ -Dhadoop-three.version="${hadoopver}" \ - -Phadoop-3.0 + ${hadoop_profile} count=$(${GREP} -c '\[ERROR\]' "${logfile}") if [[ ${count} -gt 0 ]]; then add_vote_table -1 hadoopcheck "${BUILDMODEMSG} causes ${count} errors with Hadoop v${hadoopver}." diff --git a/dev-support/hbase_nightly_yetus.sh b/dev-support/hbase_nightly_yetus.sh index ef91f207284..65b5270f0bf 100755 --- a/dev-support/hbase_nightly_yetus.sh +++ b/dev-support/hbase_nightly_yetus.sh @@ -76,7 +76,11 @@ fi # For testing with specific hadoop version. Activates corresponding profile in maven runs. if [[ -n "${HADOOP_PROFILE}" ]]; then - YETUS_ARGS=("--hadoop-profile=${HADOOP_PROFILE}" "${YETUS_ARGS[@]}") + # Master has only Hadoop3 support. We don't need to activate any profile. + # The Jenkinsfile should not attempt to run any Hadoop2 tests. + if [[ "${BRANCH_NAME}" =~ branch-2* ]]; then + YETUS_ARGS=("--hadoop-profile=${HADOOP_PROFILE}" "${YETUS_ARGS[@]}") + fi fi if [[ -n "${SKIP_ERROR_PRONE}" ]]; then diff --git a/dev-support/jenkins_precommit_github_yetus.sh b/dev-support/jenkins_precommit_github_yetus.sh index bc7221b5881..1c489d6f28b 100755 --- a/dev-support/jenkins_precommit_github_yetus.sh +++ b/dev-support/jenkins_precommit_github_yetus.sh @@ -127,7 +127,11 @@ YETUS_ARGS+=("--skip-errorprone") YETUS_ARGS+=("--skip-dirs=dev-support") # For testing with specific hadoop version. Activates corresponding profile in maven runs. if [[ -n "${HADOOP_PROFILE}" ]]; then - YETUS_ARGS+=("--hadoop-profile=${HADOOP_PROFILE}") + # Master has only Hadoop3 support. We don't need to activate any profile. + # The Jenkinsfile should not attempt to run any Hadoop2 tests. + if [[ "${BRANCH_NAME}" =~ branch-2* ]]; then + YETUS_ARGS+=("--hadoop-profile=${HADOOP_PROFILE}") + fi fi if [[ -n "${EXCLUDE_TESTS_URL}" ]]; then YETUS_ARGS+=("--exclude-tests-url=${EXCLUDE_TESTS_URL}")