Skip to content

Backport "HBASE-28569: fix race condition during WAL splitting leading to corru…" to branch-2 - #6884

Merged
Apache9 merged 1 commit into
apache:branch-2from
aristanetworks:branch-2-HBASE-28569
Apr 7, 2025
Merged

Backport "HBASE-28569: fix race condition during WAL splitting leading to corru…" to branch-2#6884
Apache9 merged 1 commit into
apache:branch-2from
aristanetworks:branch-2-HBASE-28569

Conversation

@ciacono

Copy link
Copy Markdown
Contributor

…pt recovered.edits

If an exception happens in the call to finishWriterThreads in the org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method, the call to closeWriters should not execute, as it may lead to a race condition that leads to file corruption if the regionserver aborts. The execution of closeWriters in this case would write the trailer in parallel with writer threads, causing corruption, and then the corrupt file would get renamed and finalized when it should not be. This corruption causes problems when the region is then to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful, the corrupt files should not be renamed and finalized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

…pt recovered.edits
If an exception happens in the call to finishWriterThreads in the
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method,
the call to closeWriters should not execute, as it may lead to a race condition
that leads to file corruption if the regionserver aborts. The execution of
closeWriters in this case would write the trailer in parallel with writer threads,
causing corruption, and then the corrupt file would get renamed and finalized
when it should not be. This corruption causes problems when the region is then
to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful,
the corrupt files should not be renamed and finalized.
@ciacono
ciaconoforce-pushed the branch-2-HBASE-28569 branch from 56fedf7 to 0a71793CompareApril 4, 2025 17:23
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec1m 15sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗codespell0m 0scodespell was not available.
+0 🆗detsecrets0m 0sdetect-secrets was not available.
+1 💚@author0m 0sThe patch does not contain any @author tags.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
_ branch-2 Compile Tests _
+1 💚mvninstall4m 45sbranch-2 passed
+1 💚compile3m 24sbranch-2 passed
+1 💚checkstyle0m 40sbranch-2 passed
+1 💚spotbugs1m 52sbranch-2 passed
+1 💚spotless1m 3sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall4m 12sthe patch passed
+1 💚compile3m 22sthe patch passed
+1 💚javac3m 22sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 44sthe patch passed
+1 💚spotbugs1m 55sthe patch passed
+1 💚hadoopcheck23m 22sPatch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.0.
+1 💚spotless0m 52spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 13sThe patch does not generate ASF License warnings.
49m 31s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6884
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux a12d74f14a93 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 0a71793
Default JavaEclipse Adoptium-11.0.23+9
Max. process+thread count83 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/console
versionsgit=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 51sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall3m 2sbranch-2 passed
+1 💚compile1m 0sbranch-2 passed
+1 💚javadoc0m 29sbranch-2 passed
+1 💚shadedjars6m 8sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 2sthe patch passed
+1 💚compile0m 55sthe patch passed
+1 💚javac0m 55sthe patch passed
+1 💚javadoc0m 26sthe patch passed
+1 💚shadedjars6m 7spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit204m 20shbase-server in the patch passed.
230m 51s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6884
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 5d3515fa6ae3 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 0a71793
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/testReport/
Max. process+thread count4457 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec1m 12sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall3m 57sbranch-2 passed
+1 💚compile0m 47sbranch-2 passed
+1 💚javadoc0m 29sbranch-2 passed
+1 💚shadedjars6m 7sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 29sthe patch passed
+1 💚compile0m 59sthe patch passed
+1 💚javac0m 59sthe patch passed
+1 💚javadoc0m 27sthe patch passed
+1 💚shadedjars5m 59spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit209m 50shbase-server in the patch passed.
237m 31s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#6884
Optional Testsjavac javadoc unit compile shadedjars
unameLinux ccb9701dd452 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 0a71793
Default JavaTemurin-1.8.0_412-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/testReport/
Max. process+thread count4291 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 47sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ branch-2 Compile Tests _
+1 💚mvninstall3m 24sbranch-2 passed
+1 💚compile0m 54sbranch-2 passed
+1 💚javadoc0m 27sbranch-2 passed
+1 💚shadedjars6m 28sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 6sthe patch passed
+1 💚compile0m 50sthe patch passed
+1 💚javac0m 50sthe patch passed
+1 💚javadoc0m 25sthe patch passed
+1 💚shadedjars6m 23spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit216m 54shbase-server in the patch passed.
244m 11s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#6884
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 2488e104407e 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 toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 0a71793
Default JavaEclipse Adoptium-11.0.23+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/testReport/
Max. process+thread count4438 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6884/2/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache9Apache9 added the backport This PR is a back port of some issue or issues already committed to master label Apr 7, 2025
@Apache9
Apache9 merged commit 81f29ae into apache:branch-2Apr 7, 2025
Apache9 pushed a commit that referenced this pull request Apr 7, 2025
…t recovered.edits (#6884)
If an exception happens in the call to finishWriterThreads in the
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method,
the call to closeWriters should not execute, as it may lead to a race condition
that leads to file corruption if the regionserver aborts. The execution of
closeWriters in this case would write the trailer in parallel with writer threads,
causing corruption, and then the corrupt file would get renamed and finalized
when it should not be. This corruption causes problems when the region is then
to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful,
the corrupt files should not be renamed and finalized.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 81f29ae)
Apache9 pushed a commit that referenced this pull request Apr 7, 2025
…t recovered.edits (#6884)
If an exception happens in the call to finishWriterThreads in the
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method,
the call to closeWriters should not execute, as it may lead to a race condition
that leads to file corruption if the regionserver aborts. The execution of
closeWriters in this case would write the trailer in parallel with writer threads,
causing corruption, and then the corrupt file would get renamed and finalized
when it should not be. This corruption causes problems when the region is then
to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful,
the corrupt files should not be renamed and finalized.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 81f29ae)
mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
…t recovered.edits (apache#6884)
If an exception happens in the call to finishWriterThreads in the
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method,
the call to closeWriters should not execute, as it may lead to a race condition
that leads to file corruption if the regionserver aborts. The execution of
closeWriters in this case would write the trailer in parallel with writer threads,
causing corruption, and then the corrupt file would get renamed and finalized
when it should not be. This corruption causes problems when the region is then
to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful,
the corrupt files should not be renamed and finalized.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
sanjeet006py pushed a commit to sanjeet006py/hbase that referenced this pull request Aug 24, 2025
…t recovered.edits (apache#6884)
If an exception happens in the call to finishWriterThreads in the
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method,
the call to closeWriters should not execute, as it may lead to a race condition
that leads to file corruption if the regionserver aborts. The execution of
closeWriters in this case would write the trailer in parallel with writer threads,
causing corruption, and then the corrupt file would get renamed and finalized
when it should not be. This corruption causes problems when the region is then
to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful,
the corrupt files should not be renamed and finalized.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 81f29ae)
sanjeet006py pushed a commit to sanjeet006py/hbase that referenced this pull request Sep 26, 2025
…t recovered.edits (apache#6884)
If an exception happens in the call to finishWriterThreads in the
org.apache.hadoop.hbase.wal.RecoveredEditsOutputSink.close method,
the call to closeWriters should not execute, as it may lead to a race condition
that leads to file corruption if the regionserver aborts. The execution of
closeWriters in this case would write the trailer in parallel with writer threads,
causing corruption, and then the corrupt file would get renamed and finalized
when it should not be. This corruption causes problems when the region is then
to be assigned.
To fix this, when finishWriterThreads throws an exception or is not successful,
the corrupt files should not be renamed and finalized.
Signed-off-by: Duo Zhang <zhangduo@apache.org>
(cherry picked from commit 81f29ae)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backportThis PR is a back port of some issue or issues already committed to master

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@ciacono@Apache-HBase@Apache9