Skip to content

BIGTOP-4545. hbase: versionless jar symlinks broken for version strings with extra "-<digit>" suffix#1405

Merged
iwasakims merged 1 commit into
apache:masterfrom
magnuma3:fix-wrong-hbase-jar-link
Jul 27, 2026
Merged

BIGTOP-4545. hbase: versionless jar symlinks broken for version strings with extra "-<digit>" suffix#1405
iwasakims merged 1 commit into
apache:masterfrom
magnuma3:fix-wrong-hbase-jar-link

Conversation

@magnuma3

Copy link
Copy Markdown
Contributor

Description of PR

The hbase RPM creates versionless symlinks for jars using a sed pattern:

for i in `ls hbase*jar | grep -v tests.jar`
do
    ln -s $i `echo $i | sed -n 's/\(.*\)\(-[0-9].*\)\(.jar\)/\1\3/p'`
done

The greedy (.*) makes the pattern strip only from the last "-" occurrence. This breaks for version strings that contain an additional "-" segment, e.g. a downstream/vendor version like 2.6.5-custom-1:

$ echo hbase-common-2.6.5-custom-1.jar | sed -n 's/\(.*\)\(-[0-9].*\)\(.jar\)/\1\3/p'
hbase-common-2.6.5-custom.jar

The expected link name is hbase-common.jar, but hbase-common-2.6.5-custom.jar is created instead.

Fix: match against the known HBASE_VERSION explicitly instead of guessing where the version starts:

for i in `ls hbase*jar | grep -v tests.jar`
do
   if [[ $i =~ hbase-(.*)-${HBASE_VERSION}.jar ]]; then
     name=${BASH_REMATCH[1]}
     ln -s $i hbase-$name.jar
   fi
done

How was this patch tested?

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'BIGTOP-3638. Your PR title ...')?
  • Make sure that newly added files do not have any licensing issues. When in doubt refer to https://www.apache.org/licenses/

@iwasakims iwasakims left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The change affects following files pulled from hbase-thirdparty too. I guess linking them was not intended by the original author. Let's see if existing tests are happy by merging this.

hbase-shaded-jackson-jaxrs-json-provider-4.1.13.jar
hbase-shaded-jersey-4.1.13.jar
hbase-shaded-jetty-4.1.13.jar
hbase-shaded-miscellaneous-4.1.13.jar
hbase-shaded-netty-4.1.13.jar
hbase-shaded-netty-tcnative-4.1.13.jar
hbase-shaded-protobuf-4.1.13.jar
hbase-unsafe-4.1.13.jar

@iwasakims
iwasakims merged commit e749f0d into apache:master Jul 27, 2026
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