Skip to content

HBASE-28390 WAL value compression fails for cells with large values #5696

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

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

bbeaudreault
Copy link
Contributor

@bbeaudreault bbeaudreault commented Feb 22, 2024

Unify all of the WAL compression tests to utilize tests defined in the base class. Add a testLarge test which writes large buffers. Prior to the fixes in CompressionContext and WALDecompressionBoundedDelegatingInputStream, these tests all failed.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 15s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 11s Maven dependency ordering for branch
+1 💚 mvninstall 4m 6s master passed
+1 💚 compile 4m 37s master passed
+1 💚 checkstyle 1m 27s master passed
+1 💚 spotless 0m 48s branch has no errors when running spotless:check.
+1 💚 spotbugs 3m 34s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 2m 48s the patch passed
+1 💚 compile 4m 12s the patch passed
+1 💚 javac 4m 12s the patch passed
-0 ⚠️ checkstyle 0m 35s hbase-server: The patch generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 4m 54s Patch does not cause any errors with Hadoop 3.3.6.
+1 💚 spotless 0m 42s patch has no errors when running spotless:check.
+1 💚 spotbugs 4m 26s the patch passed
_ Other Tests _
+1 💚 asflicense 1m 7s The patch does not generate ASF License warnings.
42m 30s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #5696
Optional Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
uname Linux c4438ae23f31 5.4.0-166-generic #183-Ubuntu SMP Mon Oct 2 11:28:33 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 7be588e
Default Java Eclipse Adoptium-11.0.17+8
checkstyle https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/artifact/yetus-general-check/output/diff-checkstyle-hbase-server.txt
Max. process+thread count 79 (vs. ulimit of 30000)
modules C: hbase-server hbase-compression/hbase-compression-aircompressor hbase-compression/hbase-compression-brotli hbase-compression/hbase-compression-lz4 hbase-compression/hbase-compression-snappy hbase-compression/hbase-compression-xz hbase-compression/hbase-compression-zstd U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/console
versions git=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 38s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 3m 5s master passed
+1 💚 compile 2m 22s master passed
+1 💚 shadedjars 5m 14s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 44s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 13s Maven dependency ordering for patch
+1 💚 mvninstall 2m 45s the patch passed
+1 💚 compile 2m 21s the patch passed
+1 💚 javac 2m 21s the patch passed
+1 💚 shadedjars 5m 11s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 43s the patch passed
_ Other Tests _
+1 💚 unit 230m 8s hbase-server in the patch passed.
+1 💚 unit 1m 16s hbase-compression-aircompressor in the patch passed.
+1 💚 unit 0m 57s hbase-compression-brotli in the patch passed.
+1 💚 unit 0m 47s hbase-compression-lz4 in the patch passed.
+1 💚 unit 0m 48s hbase-compression-snappy in the patch passed.
+1 💚 unit 2m 53s hbase-compression-xz in the patch passed.
+1 💚 unit 6m 15s hbase-compression-zstd in the patch passed.
274m 1s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #5696
Optional Tests javac javadoc unit shadedjars compile
uname Linux 2d5cc2c686a7 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 7be588e
Default Java Eclipse Adoptium-11.0.17+8
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/testReport/
Max. process+thread count 5630 (vs. ulimit of 30000)
modules C: hbase-server hbase-compression/hbase-compression-aircompressor hbase-compression/hbase-compression-brotli hbase-compression/hbase-compression-lz4 hbase-compression/hbase-compression-snappy hbase-compression/hbase-compression-xz hbase-compression/hbase-compression-zstd U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 27s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 14s Maven dependency ordering for branch
+1 💚 mvninstall 2m 52s master passed
+1 💚 compile 1m 56s master passed
+1 💚 shadedjars 5m 45s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 24s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 2m 31s the patch passed
+1 💚 compile 1m 56s the patch passed
+1 💚 javac 1m 56s the patch passed
+1 💚 shadedjars 5m 41s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 22s the patch passed
_ Other Tests _
+1 💚 unit 232m 39s hbase-server in the patch passed.
+1 💚 unit 1m 9s hbase-compression-aircompressor in the patch passed.
+1 💚 unit 0m 51s hbase-compression-brotli in the patch passed.
+1 💚 unit 0m 41s hbase-compression-lz4 in the patch passed.
+1 💚 unit 0m 42s hbase-compression-snappy in the patch passed.
+1 💚 unit 3m 19s hbase-compression-xz in the patch passed.
+1 💚 unit 5m 22s hbase-compression-zstd in the patch passed.
273m 48s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #5696
Optional Tests javac javadoc unit shadedjars compile
uname Linux f180f4d304a8 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 7be588e
Default Java Temurin-1.8.0_352-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/testReport/
Max. process+thread count 5104 (vs. ulimit of 30000)
modules C: hbase-server hbase-compression/hbase-compression-aircompressor hbase-compression/hbase-compression-brotli hbase-compression/hbase-compression-lz4 hbase-compression/hbase-compression-snappy hbase-compression/hbase-compression-xz hbase-compression/hbase-compression-zstd U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5696/1/console
versions git=2.34.1 maven=3.8.6
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

}
}

private int rawReadInt(InputStream in) throws IOException {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised commons-io or our own util code doesn't have something like this already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried looking and couldn't find one. I'll try looking again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Woops I think IOUtils.readInt should work. Any other comments/concerns other than that?

Copy link
Contributor

Choose a reason for hiding this comment

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

Left an approving review with the rest. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, there is no IOUtils.readInt in commons-io. I realized that the IOUtils I was referring to (while on mobile) was a different library that we don't have a dependency on.

We have a variety of methods for reading ints from byte[] or ByteBuffer, but not for InputStream that I can find. I could read the bytes into a byte[4] and use one of the utils, but I'd rather not allocate an unnecessary byte array. I'm going to leave this alone for now.

@@ -67,14 +71,36 @@ public class CompressedWALTestBase {
Arrays.fill(VALUE, off, (off += 1597), (byte) 'Q');
}

public void doTest(TableName tableName) throws Exception {
@Test
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for cleaning this up and removing all the unneeded boilerplate.

// if the uncompressed size was larger than the configured buffer size for the codec,
// the BlockCompressorStream will have left an extra 4 bytes hanging. This represents a size
// for the next segment, and it should be 0. See HBASE-28390
if (lowerIn.available() == 4) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This part is ugly but I don't have an alternative suggestion. At least we know both in the WAL read and HFile read cases we won't be contending with a short read, so available is going to be either 0 or 4 and otherwise we'd have had an EOFException thrown.

@bbeaudreault bbeaudreault merged commit 0ea11f2 into apache:master Feb 23, 2024
@bbeaudreault bbeaudreault deleted the HBASE-28390 branch February 23, 2024 17:30
bbeaudreault added a commit that referenced this pull request Feb 23, 2024
…5696)

Signed-off-by: Andrew Purtell <apurtell@apache.org>
bbeaudreault added a commit that referenced this pull request Feb 23, 2024
…5696)

Signed-off-by: Andrew Purtell <apurtell@apache.org>
bbeaudreault added a commit that referenced this pull request Feb 23, 2024
…5696)

Signed-off-by: Andrew Purtell <apurtell@apache.org>
bbeaudreault added a commit that referenced this pull request Feb 23, 2024
…5696)

Signed-off-by: Andrew Purtell <apurtell@apache.org>
bbeaudreault added a commit to HubSpot/hbase that referenced this pull request Mar 4, 2024
…ith large values (apache#5696)

Signed-off-by: Andrew Purtell <apurtell@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.

3 participants