Skip to content

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

Merged
openinx merged 1 commit into
apache:masterfrom
chenxu14:HBASE-22965
Sep 30, 2019
Merged

HBASE-22965 RS Crash due to DBE reference to an reused ByteBuff#603
openinx merged 1 commit into
apache:masterfrom
chenxu14:HBASE-22965

Conversation

@chenxu14

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 40sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙mvndep0m 35sMaven dependency ordering for branch
💚mvninstall5m 11smaster passed
💚compile1m 19smaster passed
💚checkstyle1m 45smaster passed
💚shadedjars4m 35sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 58smaster passed
💙spotbugs4m 0sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs4m 48smaster passed
_ Patch Compile Tests _
💙mvndep0m 15sMaven dependency ordering for patch
💚mvninstall4m 53sthe patch passed
💚compile1m 20sthe patch passed
💚javac1m 20sthe patch passed
💔checkstyle0m 26shbase-common: The patch generated 2 new + 1 unchanged - 0 fixed = 3 total (was 1)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 32spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 31sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 55sthe patch passed
💚findbugs4m 59sthe patch passed
_ Other Tests _
💚unit3m 5shbase-common in the patch passed.
💔unit159m 50shbase-server in the patch failed.
💚asflicense0m 56sThe patch does not generate ASF License warnings.
224m 25s
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux c0134af57db9 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revisionmaster / 4ca760f
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/artifact/out/diff-checkstyle-hbase-common.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/testReport/
Max. process+thread count4860 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec1m 10sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙mvndep0m 34sMaven dependency ordering for branch
💚mvninstall5m 43smaster passed
💚compile1m 23smaster passed
💚checkstyle1m 55smaster passed
💚shadedjars4m 58sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 58smaster passed
💙spotbugs4m 21sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 11smaster passed
_ Patch Compile Tests _
💙mvndep0m 14sMaven dependency ordering for patch
💚mvninstall5m 36sthe patch passed
💚compile1m 18sthe patch passed
💚javac1m 18sthe patch passed
💚checkstyle1m 56sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 57spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 14sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 56sthe patch passed
💚findbugs5m 24sthe patch passed
_ Other Tests _
💚unit2m 56shbase-common in the patch passed.
💚unit231m 36shbase-server in the patch passed.
💚asflicense0m 48sThe patch does not generate ASF License warnings.
301m 48s
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 03ad664a5209 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revisionmaster / 4ca760f
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/2/testReport/
Max. process+thread count4559 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/2/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache 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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

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

/** Meta data that holds information about the hfileblock**/
private HFileContext fileContext;

void beforeShipped() {

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

done it

return lastCell;
}

@VisibleForTesting

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec1m 12sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 2 new or modified test files.
_ master Compile Tests _
💙mvndep1m 1sMaven dependency ordering for branch
💚mvninstall5m 38smaster passed
💚compile1m 19smaster passed
💚checkstyle1m 55smaster passed
💚shadedjars4m 52sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 57smaster passed
💙spotbugs4m 22sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 12smaster passed
_ Patch Compile Tests _
💙mvndep0m 14sMaven dependency ordering for patch
💚mvninstall5m 27sthe patch passed
💚compile1m 18sthe patch passed
💚javac1m 18sthe patch passed
💚checkstyle1m 54sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 58spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck19m 22sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 56sthe patch passed
💚findbugs5m 23sthe patch passed
_ Other Tests _
💚unit2m 57shbase-common in the patch passed.
💚unit225m 4shbase-server in the patch passed.
💚asflicense0m 51sThe patch does not generate ASF License warnings.
297m 33s
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 1fceb1ac515e 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revisionmaster / c0e5c15
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/3/testReport/
Max. process+thread count4398 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/3/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 32sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙mvndep0m 36sMaven dependency ordering for branch
💚mvninstall5m 17smaster passed
💚compile1m 20smaster passed
💚checkstyle1m 45smaster passed
💚shadedjars4m 42sbranch has no errors when building our shaded downstream artifacts.
💚javadoc1m 1smaster passed
💙spotbugs4m 16sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 4smaster passed
_ Patch Compile Tests _
💙mvndep0m 15sMaven dependency ordering for patch
💚mvninstall4m 53sthe patch passed
💚compile1m 19sthe patch passed
💚javac1m 19sthe patch passed
💚checkstyle1m 45sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 30spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 34sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 56sthe patch passed
💚findbugs5m 3sthe patch passed
_ Other Tests _
💚unit3m 8shbase-common in the patch passed.
💔unit170m 36shbase-server in the patch failed.
💚asflicense1m 2sThe patch does not generate ASF License warnings.
235m 47s
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux bab7f54bf1a2 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revisionmaster / cb62f73
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/testReport/
Max. process+thread count5118 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/4/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@chenxu14

Copy link
Copy Markdown
ContributorAuthor

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
Copy Markdown
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
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

thanks for the feedback

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
💙reexec0m 29sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙mvndep1m 0sMaven dependency ordering for branch
💚mvninstall5m 42smaster passed
💚compile1m 20smaster passed
💚checkstyle1m 57smaster passed
💚shadedjars5m 3sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 57smaster passed
💙spotbugs4m 25sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 11smaster passed
_ Patch Compile Tests _
💙mvndep0m 13sMaven dependency ordering for patch
💚mvninstall5m 23sthe patch passed
💚compile1m 20sthe patch passed
💚javac1m 20sthe patch passed
💚checkstyle1m 55sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 1spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 7sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc1m 3sthe patch passed
💚findbugs5m 55sthe patch passed
_ Other Tests _
💚unit3m 2shbase-common in the patch passed.
💚unit151m 38shbase-server in the patch passed.
💚asflicense0m 48sThe patch does not generate ASF License warnings.
222m 2s
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux a835b65d9152 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revisionmaster / 3250a80
Default Java1.8.0_181
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/5/testReport/
Max. process+thread count4412 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/5/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 29sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💙mvndep0m 34sMaven dependency ordering for branch
💚mvninstall5m 47smaster passed
💚compile1m 19smaster passed
💚checkstyle2m 0smaster passed
💚shadedjars5m 1sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 56smaster passed
💙spotbugs4m 26sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs5m 12smaster passed
_ Patch Compile Tests _
💙mvndep0m 14sMaven dependency ordering for patch
💚mvninstall5m 24sthe patch passed
💚compile1m 20sthe patch passed
💚javac1m 20sthe patch passed
💚checkstyle1m 54sthe patch passed
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars5m 2spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck17m 8sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 54sthe patch passed
💚findbugs5m 27sthe patch passed
_ Other Tests _
💚unit2m 55shbase-common in the patch passed.
💔unit157m 43shbase-server in the patch failed.
💚asflicense0m 48sThe patch does not generate ASF License warnings.
227m 11s
ReasonTests
Failed junit testshadoop.hbase.master.assignment.TestReportOnlineRegionsRace
SubsystemReport/Notes
DockerClient=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 Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux e86fc3b51c19 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-603/out/precommit/personality/provided.sh
git revisionmaster / ef79b40
Default Java1.8.0_181
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/testReport/
Max. process+thread count4538 (vs. ulimit of 10000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-603/6/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@openinxopeninx 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.

Looks good to me.

@openinx
openinx merged commit ce0fbc2 into apache:masterSep 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 freeto 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

@chenxu14@Apache-HBase@anoopsjohn@openinx