Skip to content

HBASE-22965 RS Crash due to DBE reference to an reused ByteBuff #603

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
Sep 30, 2019
Merged

HBASE-22965 RS Crash due to DBE reference to an reused ByteBuff #603

merged 1 commit into from
Sep 30, 2019

Conversation

chenxu14
Copy link
Contributor

No description provided.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
💙 reexec 0m 40s Docker mode activated.
_ Prechecks _
💚 dupname 0m 0s No case conflicting files found.
💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
💚 @author 0m 0s The patch does not contain any @author tags.
💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙 mvndep 0m 35s Maven dependency ordering for branch
💚 mvninstall 5m 11s master passed
💚 compile 1m 19s master passed
💚 checkstyle 1m 45s master passed
💚 shadedjars 4m 35s branch has no errors when building our shaded downstream artifacts.
💚 javadoc 0m 58s master passed
💙 spotbugs 4m 0s Used deprecated FindBugs config; considering switching to SpotBugs.
💚 findbugs 4m 48s master passed
_ Patch Compile Tests _
💙 mvndep 0m 15s Maven dependency ordering for patch
💚 mvninstall 4m 53s the patch passed
💚 compile 1m 20s the patch passed
💚 javac 1m 20s the patch passed
💔 checkstyle 0m 26s hbase-common: The patch generated 2 new + 1 unchanged - 0 fixed = 3 total (was 1)
💚 whitespace 0m 0s The patch has no whitespace issues.
💚 shadedjars 4m 32s patch has no errors when building our shaded downstream artifacts.
💚 hadoopcheck 15m 31s Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚 javadoc 0m 55s the patch passed
💚 findbugs 4m 59s the patch passed
_ Other Tests _
💚 unit 3m 5s hbase-common in the patch passed.
💔 unit 159m 50s hbase-server in the patch failed.
💚 asflicense 0m 56s The patch does not generate ASF License warnings.
224m 25s
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/artifact/out/Dockerfile
GITHUB PR #603
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux c0134af57db9 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revision master / 4ca760f
Default Java 1.8.0_181
checkstyle https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/artifact/out/diff-checkstyle-hbase-common.txt
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/testReport/
Max. process+thread count 4860 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
💙 reexec 1m 10s Docker mode activated.
_ Prechecks _
💚 dupname 0m 0s No case conflicting files found.
💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
💚 @author 0m 0s The patch does not contain any @author tags.
💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙 mvndep 0m 34s Maven dependency ordering for branch
💚 mvninstall 5m 43s master passed
💚 compile 1m 23s master passed
💚 checkstyle 1m 55s master passed
💚 shadedjars 4m 58s branch has no errors when building our shaded downstream artifacts.
💚 javadoc 0m 58s master passed
💙 spotbugs 4m 21s Used deprecated FindBugs config; considering switching to SpotBugs.
💚 findbugs 5m 11s master passed
_ Patch Compile Tests _
💙 mvndep 0m 14s Maven dependency ordering for patch
💚 mvninstall 5m 36s the patch passed
💚 compile 1m 18s the patch passed
💚 javac 1m 18s the patch passed
💚 checkstyle 1m 56s the patch passed
💚 whitespace 0m 0s The patch has no whitespace issues.
💚 shadedjars 4m 57s patch has no errors when building our shaded downstream artifacts.
💚 hadoopcheck 17m 14s Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚 javadoc 0m 56s the patch passed
💚 findbugs 5m 24s the patch passed
_ Other Tests _
💚 unit 2m 56s hbase-common in the patch passed.
💚 unit 231m 36s hbase-server in the patch passed.
💚 asflicense 0m 48s The patch does not generate ASF License warnings.
301m 48s
Subsystem Report/Notes
Docker Client=19.03.2 Server=19.03.2 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/2/artifact/out/Dockerfile
GITHUB PR #603
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 03ad664a5209 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revision master / 4ca760f
Default Java 1.8.0_181
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/2/testReport/
Max. process+thread count 4559 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/2/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.


public void beforeShipped() {
if (this.prevCell != null) {
this.prevCell = KeyValueUtil.copyToNewKeyValue(this.prevCell);
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems we need both key and value from the prevCell in FastDiffDeltaEncoder and all. Just add a comment saying so. Normally we copy the key part alone in beforeShipped

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done it

return prevCell;
}

public void beforeShipped() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not making it ShipperListener. That would be best

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If do so, we should move ShipperListener to hbase-common first

@@ -840,6 +841,16 @@ public boolean isSharedMem() {
/** Meta data that holds information about the hfileblock**/
private HFileContext fileContext;

void beforeShipped() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not making it ShipperListener. That would be best

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done it

@@ -781,6 +783,11 @@ public Cell getLastCell() {
return lastCell;
}

@VisibleForTesting
Copy link
Contributor

Choose a reason for hiding this comment

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

So many method exposes for the test-ability. Are we really testing the FT way? That a prevCell been passed and we pollute that cell's backing BB/byte[] after a shipped call? That would be the best and in that I dont think we need to expose these many method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

replace the UT with TestHFile#testDBEShipped

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
💙 reexec 1m 12s Docker mode activated.
_ Prechecks _
💚 dupname 0m 0s No case conflicting files found.
💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
💚 @author 0m 0s The patch does not contain any @author tags.
💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ master Compile Tests _
💙 mvndep 1m 1s Maven dependency ordering for branch
💚 mvninstall 5m 38s master passed
💚 compile 1m 19s master passed
💚 checkstyle 1m 55s master passed
💚 shadedjars 4m 52s branch has no errors when building our shaded downstream artifacts.
💚 javadoc 0m 57s master passed
💙 spotbugs 4m 22s Used deprecated FindBugs config; considering switching to SpotBugs.
💚 findbugs 5m 12s master passed
_ Patch Compile Tests _
💙 mvndep 0m 14s Maven dependency ordering for patch
💚 mvninstall 5m 27s the patch passed
💚 compile 1m 18s the patch passed
💚 javac 1m 18s the patch passed
💚 checkstyle 1m 54s the patch passed
💚 whitespace 0m 0s The patch has no whitespace issues.
💚 shadedjars 4m 58s patch has no errors when building our shaded downstream artifacts.
💚 hadoopcheck 19m 22s Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚 javadoc 0m 56s the patch passed
💚 findbugs 5m 23s the patch passed
_ Other Tests _
💚 unit 2m 57s hbase-common in the patch passed.
💚 unit 225m 4s hbase-server in the patch passed.
💚 asflicense 0m 51s The patch does not generate ASF License warnings.
297m 33s
Subsystem Report/Notes
Docker Client=19.03.2 Server=19.03.2 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/3/artifact/out/Dockerfile
GITHUB PR #603
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux 1fceb1ac515e 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revision master / c0e5c15
Default Java 1.8.0_181
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/3/testReport/
Max. process+thread count 4398 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/3/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
💙 reexec 0m 32s Docker mode activated.
_ Prechecks _
💚 dupname 0m 0s No case conflicting files found.
💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
💚 @author 0m 0s The patch does not contain any @author tags.
💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙 mvndep 0m 36s Maven dependency ordering for branch
💚 mvninstall 5m 17s master passed
💚 compile 1m 20s master passed
💚 checkstyle 1m 45s master passed
💚 shadedjars 4m 42s branch has no errors when building our shaded downstream artifacts.
💚 javadoc 1m 1s master passed
💙 spotbugs 4m 16s Used deprecated FindBugs config; considering switching to SpotBugs.
💚 findbugs 5m 4s master passed
_ Patch Compile Tests _
💙 mvndep 0m 15s Maven dependency ordering for patch
💚 mvninstall 4m 53s the patch passed
💚 compile 1m 19s the patch passed
💚 javac 1m 19s the patch passed
💚 checkstyle 1m 45s the patch passed
💚 whitespace 0m 0s The patch has no whitespace issues.
💚 shadedjars 4m 30s patch has no errors when building our shaded downstream artifacts.
💚 hadoopcheck 15m 34s Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚 javadoc 0m 56s the patch passed
💚 findbugs 5m 3s the patch passed
_ Other Tests _
💚 unit 3m 8s hbase-common in the patch passed.
💔 unit 170m 36s hbase-server in the patch failed.
💚 asflicense 1m 2s The patch does not generate ASF License warnings.
235m 47s
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/artifact/out/Dockerfile
GITHUB PR #603
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux bab7f54bf1a2 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revision master / cb62f73
Default Java 1.8.0_181
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/testReport/
Max. process+thread count 5118 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@chenxu14
Copy link
Contributor Author

Hi @anoopsjohn , do you think the PR is OK now? or do I need to make any adjustments?

writer.beforeShipped();

Cell cell = writer.blockWriter.getEncodingState().getLastCell();
assertTrue(cell instanceof KeyValue);
Copy link
Contributor

Choose a reason for hiding this comment

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

The UT is not really doing a meaningful test. Write a cell first and then pollute its backing ByteBuffer by directly manipulating few bytes which comes at some KeyLen part or so. Then write another cell. Call the beforeShipped() before manipulating this 1st BB. With out the patch, we will end up in some issues. The patch should fix it.
Even we can remove all these new getters exposed in different classes for testing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for the feedback

@chenxu14 chenxu14 requested a review from anoopsjohn September 27, 2019 15:47
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
💙 reexec 0m 29s Docker mode activated.
_ Prechecks _
💚 dupname 0m 0s No case conflicting files found.
💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
💚 @author 0m 0s The patch does not contain any @author tags.
💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙 mvndep 1m 0s Maven dependency ordering for branch
💚 mvninstall 5m 42s master passed
💚 compile 1m 20s master passed
💚 checkstyle 1m 57s master passed
💚 shadedjars 5m 3s branch has no errors when building our shaded downstream artifacts.
💚 javadoc 0m 57s master passed
💙 spotbugs 4m 25s Used deprecated FindBugs config; considering switching to SpotBugs.
💚 findbugs 5m 11s master passed
_ Patch Compile Tests _
💙 mvndep 0m 13s Maven dependency ordering for patch
💚 mvninstall 5m 23s the patch passed
💚 compile 1m 20s the patch passed
💚 javac 1m 20s the patch passed
💚 checkstyle 1m 55s the patch passed
💚 whitespace 0m 0s The patch has no whitespace issues.
💚 shadedjars 5m 1s patch has no errors when building our shaded downstream artifacts.
💚 hadoopcheck 17m 7s Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚 javadoc 1m 3s the patch passed
💚 findbugs 5m 55s the patch passed
_ Other Tests _
💚 unit 3m 2s hbase-common in the patch passed.
💚 unit 151m 38s hbase-server in the patch passed.
💚 asflicense 0m 48s The patch does not generate ASF License warnings.
222m 2s
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/5/artifact/out/Dockerfile
GITHUB PR #603
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux a835b65d9152 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revision master / 3250a80
Default Java 1.8.0_181
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/5/testReport/
Max. process+thread count 4412 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/5/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
💙 reexec 0m 29s Docker mode activated.
_ Prechecks _
💚 dupname 0m 0s No case conflicting files found.
💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
💚 @author 0m 0s The patch does not contain any @author tags.
💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙 mvndep 0m 34s Maven dependency ordering for branch
💚 mvninstall 5m 47s master passed
💚 compile 1m 19s master passed
💚 checkstyle 2m 0s master passed
💚 shadedjars 5m 1s branch has no errors when building our shaded downstream artifacts.
💚 javadoc 0m 56s master passed
💙 spotbugs 4m 26s Used deprecated FindBugs config; considering switching to SpotBugs.
💚 findbugs 5m 12s master passed
_ Patch Compile Tests _
💙 mvndep 0m 14s Maven dependency ordering for patch
💚 mvninstall 5m 24s the patch passed
💚 compile 1m 20s the patch passed
💚 javac 1m 20s the patch passed
💚 checkstyle 1m 54s the patch passed
💚 whitespace 0m 0s The patch has no whitespace issues.
💚 shadedjars 5m 2s patch has no errors when building our shaded downstream artifacts.
💚 hadoopcheck 17m 8s Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚 javadoc 0m 54s the patch passed
💚 findbugs 5m 27s the patch passed
_ Other Tests _
💚 unit 2m 55s hbase-common in the patch passed.
💔 unit 157m 43s hbase-server in the patch failed.
💚 asflicense 0m 48s The patch does not generate ASF License warnings.
227m 11s
Reason Tests
Failed junit tests hadoop.hbase.master.assignment.TestReportOnlineRegionsRace
Subsystem Report/Notes
Docker Client=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/artifact/out/Dockerfile
GITHUB PR #603
Optional Tests dupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
uname Linux e86fc3b51c19 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 GNU/Linux
Build tool maven
Personality /home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revision master / ef79b40
Default Java 1.8.0_181
unit https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/artifact/out/patch-unit-hbase-server.txt
Test Results https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/testReport/
Max. process+thread count 4538 (vs. ulimit of 10000)
modules C: hbase-common hbase-server U: .
Console output https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/console
versions git=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered by Apache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Member

@openinx openinx left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@openinx openinx merged commit ce0fbc2 into apache:master Sep 30, 2019
asfgit pushed a commit that referenced this pull request Sep 30, 2019
asfgit pushed a commit that referenced this pull request Sep 30, 2019
asfgit pushed a commit that referenced this pull request Sep 30, 2019
infraio pushed a commit to infraio/hbase that referenced this pull request Aug 17, 2020
symat pushed a commit to symat/hbase that referenced this pull request Feb 17, 2021
…he#603)

Signed-off-by: huzheng <openinx@gmail.com>
(cherry picked from commit e54f32e)

Change-Id: Ibdb7297be556e6cd7e12ac96b7a23e8cb89393ad
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.

4 participants