Skip to content

HBASE-30538 Bump snappy-java to 1.1.10.12 - #8870

Merged
Umeshkumar9414 merged 2 commits into
apache:masterfrom
nirdosh0110:HBASE-30538
Nov 13, 2026
Merged

Umeshkumar9414 merged 2 commits into
apache:masterfrom
nirdosh0110:HBASE-30538

Conversation

@nirdosh0110

@nirdosh0110 nirdosh0110 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

https://issues.apache.org/jira/browse/HBASE-30538

snappy-java 1.1.10.9 (HBASE-30508) added an output-space check in Snappy.compress(ByteBuffer, ByteBuffer) against compressed.remaining(). Hadoop's SnappyCompressor sets compressedDirectBuf.limit(0) before compressing, so writes through Hadoop SnappyCodec (the default codec for Compression.Algorithm.SNAPPY) fail with not enough space for output: need N bytes, but only 0 remaining.

Fixed upstream in 1.1.10.11 (xerial/snappy-java#765, #766); 1.1.10.12 also fixes #767. Hadoop trunk and Spark are already on 1.1.10.12.

Adds TestHadoopSnappyCodec (hbase-common), a round trip through Compression.Algorithm.SNAPPY with the default Hadoop SnappyCodec. Verified locally: fails on 1.1.10.9 and 1.1.10.10 with not enough space for output: need 254,857 bytes, but only 0 remaining, passes on 1.1.10.11 and 1.1.10.12.

🤖 Generated with Claude Code

snappy-java 1.1.10.9 added an output-space check in
Snappy.compress(ByteBuffer, ByteBuffer) based on remaining(), which
rejects Hadoop SnappyCompressor (output limit(0) before compress) and
breaks writes through Hadoop SnappyCodec. Fixed in 1.1.10.11 (apache#766);
1.1.10.12 also fixes apache#767.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Umeshkumar9414
Umeshkumar9414 requested a balanced review from Copilot November 12, 2026 07:34

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

No open issues 🎉

What changed in this PR

Updates HBase’s snappy-java dependency to a newer upstream release that fixes a Hadoop SnappyCompressor interop regression in Snappy.compress(ByteBuffer, ByteBuffer) when the output buffer limit is set to 0.

Changes:

  • Bump snappy-java version from 1.1.10.9 to 1.1.10.12 in the Maven build properties.
File Description
pom.xml Updates the snappy.version property to pull in the fixed snappy-java release.

Review effort: Lite

Fails with snappy-java 1.1.10.9/1.1.10.10 ('not enough space for
output'), passes with 1.1.10.11+.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Umeshkumar9414
Umeshkumar9414 requested a lite review from Copilot November 12, 2026 13:23
@nirdosh0110

Copy link
Copy Markdown
Contributor Author

Reproduced locally with the new TestHadoopSnappyCodec by overriding snappy.version:

mvn -pl hbase-common test -Dtest=TestHadoopSnappyCodec -Dsnappy.version=<version>
snappy-java Result
1.1.10.9 (current master) ERROR
1.1.10.10 ERROR
1.1.10.11 PASS
1.1.10.12 (this PR) PASS

Failure on 1.1.10.9:

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0 <<< FAILURE! -- in org.apache.hadoop.hbase.io.compress.TestHadoopSnappyCodec
org.apache.hadoop.hbase.io.compress.TestHadoopSnappyCodec.testRoundTrip <<< ERROR!
java.lang.IllegalArgumentException: not enough space for output: need 254,857 bytes, but only 0 remaining
	at org.xerial.snappy.Snappy.checkOutputSpace(Snappy.java:613)
	at org.xerial.snappy.Snappy.compress(Snappy.java:160)
	at org.apache.hadoop.io.compress.snappy.SnappyCompressor.compressDirectBuf(SnappyCompressor.java:282)
	at org.apache.hadoop.io.compress.snappy.SnappyCompressor.compress(SnappyCompressor.java:210)
	at org.apache.hadoop.io.compress.BlockCompressorStream.compress(BlockCompressorStream.java:149)
	at org.apache.hadoop.io.compress.BlockCompressorStream.write(BlockCompressorStream.java:115)
	at org.apache.hadoop.hbase.io.compress.Compression$FinishOnFlushCompressionStream.write(Compression.java:112)
	at java.base/java.io.BufferedOutputStream.write(BufferedOutputStream.java:123)
	at org.apache.hadoop.hbase.io.compress.TestHadoopSnappyCodec.testRoundTrip(TestHadoopSnappyCodec.java:61)

This is the same path HFile block compression takes for SNAPPY column families with the default hbase.io.compress.snappy.codec, so flushes and compactions on those families would fail with 1.1.10.9.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Umeshkumar9414

Umeshkumar9414 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Thanks @nirdosh0110 for the fix and for adding TestHadoopSnappyCodec.

@Umeshkumar9414

Copy link
Copy Markdown
Contributor

@nirdosh0110 please raise backport PRs for branch-2.x.
branch-3 / branch-3.0: both commits cherry-pick cleanly, and the test passes.
branch-2 / branch-2.6 / branch-2.5: the version bump applies (branch-2.5 needs a small fix in pom.xml). The new test fails on their default Hadoop 2.10.2 profile because Hadoop 2's SnappyCodec uses native libraries. One option I see is we can guard the test so it skips on Hadoop 2.

@Umeshkumar9414
Umeshkumar9414 merged commit 01c80e5 into apache:master Nov 13, 2026
8 checks passed
Umeshkumar9414 pushed a commit that referenced this pull request Nov 13, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Umesh Kumar Kumawat <ukumawat@apache.org>
Umeshkumar9414 pushed a commit that referenced this pull request Nov 13, 2026
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Umesh Kumar Kumawat <ukumawat@apache.org>
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.

6 participants