Skip to content

HBASE-28801 WALs are not cleaned even after all entries are flushed - #6179

Open
kiran-maturi wants to merge 3 commits into
apache:branch-2from
kiran-maturi:HBASE-28801
Open

HBASE-28801 WALs are not cleaned even after all entries are flushed#6179
kiran-maturi wants to merge 3 commits into
apache:branch-2from
kiran-maturi:HBASE-28801

Conversation

@kiran-maturi

Copy link
Copy Markdown
Contributor

No description provided.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 41sDocker 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 1sPatch does not have any anti-patterns.
_ branch-2 Compile Tests _
+1 💚mvninstall3m 27sbranch-2 passed
+1 💚compile2m 53sbranch-2 passed
+1 💚checkstyle0m 39sbranch-2 passed
+1 💚spotbugs1m 35sbranch-2 passed
+1 💚spotless0m 46sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall3m 13sthe patch passed
+1 💚compile2m 54sthe patch passed
+1 💚javac2m 54sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
-0 ⚠️checkstyle0m 36s/results-checkstyle-hbase-server.txthbase-server: The patch generated 1 new + 2 unchanged - 0 fixed = 3 total (was 2)
+1 💚spotbugs1m 43sthe patch passed
+1 💚hadoopcheck16m 49sPatch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.0.
-1 ❌spotless0m 38spatch has 23 errors when running spotless:check, run spotless:apply to fix.
_ Other Tests _
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
37m 57s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6179
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux eb031ed13b25 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 / 2a1f223
Default JavaEclipse Adoptium-11.0.23+9
spotlesshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/artifact/yetus-general-check/output/patch-spotless.txt
Max. process+thread count77 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/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 🆗reexec1m 11sDocker mode activated.
-0 ⚠️yetus0m 6sUnprocessed 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 💚mvninstall5m 5sbranch-2 passed
+1 💚compile1m 31sbranch-2 passed
+1 💚javadoc0m 50sbranch-2 passed
+1 💚shadedjars8m 40sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall4m 43sthe patch passed
+1 💚compile1m 28sthe patch passed
+1 💚javac1m 28sthe patch passed
+1 💚javadoc0m 39sthe patch passed
+1 💚shadedjars8m 16spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit26m 16s/patch-unit-hbase-server.txthbase-server in the patch failed.
60m 52s
SubsystemReport/Notes
DockerClientAPI=1.46 ServerAPI=1.46 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 5043cc1c30df 5.4.0-186-generic #206-Ubuntu SMP Fri Apr 26 12:31:10 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 2a1f223
Default JavaEclipse Adoptium-11.0.23+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/testReport/
Max. process+thread count1570 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/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 39sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed 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 7sbranch-2 passed
+1 💚compile0m 57sbranch-2 passed
+1 💚javadoc0m 31sbranch-2 passed
+1 💚shadedjars5m 34sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 56sthe patch passed
+1 💚compile0m 57sthe patch passed
+1 💚javac0m 57sthe patch passed
+1 💚javadoc0m 29sthe patch passed
+1 💚shadedjars5m 31spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit227m 1s/patch-unit-hbase-server.txthbase-server in the patch failed.
252m 21s
SubsystemReport/Notes
DockerClientAPI=1.46 ServerAPI=1.46 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux ade5416f6839 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 2a1f223
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/testReport/
Max. process+thread count4491 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/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 42sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed 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 💚mvninstall2m 38sbranch-2 passed
+1 💚compile0m 47sbranch-2 passed
+1 💚javadoc0m 28sbranch-2 passed
+1 💚shadedjars5m 1sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 31sthe patch passed
+1 💚compile0m 45sthe patch passed
+1 💚javac0m 45sthe patch passed
+1 💚javadoc0m 27sthe patch passed
+1 💚shadedjars5m 5spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit233m 59shbase-server in the patch passed.
256m 49s
SubsystemReport/Notes
DockerClientAPI=1.46 ServerAPI=1.46 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux b77a4d8f57d3 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 2a1f223
Default JavaTemurin-1.8.0_412-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/testReport/
Max. process+thread count4373 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/1/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 45sDocker 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 💚mvninstall3m 7sbranch-2 passed
+1 💚compile2m 51sbranch-2 passed
+1 💚checkstyle0m 38sbranch-2 passed
+1 💚spotbugs1m 32sbranch-2 passed
+1 💚spotless0m 45sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall3m 5sthe patch passed
+1 💚compile2m 51sthe patch passed
+1 💚javac2m 51sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 37sthe patch passed
+1 💚spotbugs1m 41sthe patch passed
+1 💚hadoopcheck16m 43sPatch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.0.
+1 💚spotless0m 46spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 9sThe patch does not generate ASF License warnings.
37m 9s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6179
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 8324560a61f0 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 / 69cdb54
Default JavaEclipse Adoptium-11.0.23+9
Max. process+thread count79 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/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 45sDocker 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 💚mvninstall2m 41sbranch-2 passed
+1 💚compile0m 42sbranch-2 passed
+1 💚javadoc0m 24sbranch-2 passed
+1 💚shadedjars5m 20sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 23sthe patch passed
+1 💚compile0m 41sthe patch passed
+1 💚javac0m 41sthe patch passed
+1 💚javadoc0m 24sthe patch passed
+1 💚shadedjars5m 15spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit227m 17shbase-server in the patch passed.
251m 16s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 0b3084b27d58 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 / 69cdb54
Default JavaTemurin-1.8.0_412-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/testReport/
Max. process+thread count4288 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/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 40sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed 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 5sbranch-2 passed
+1 💚compile0m 58sbranch-2 passed
+1 💚javadoc0m 31sbranch-2 passed
+1 💚shadedjars5m 33sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall2m 56sthe patch passed
+1 💚compile0m 57sthe patch passed
+1 💚javac0m 57sthe patch passed
+1 💚javadoc0m 28sthe patch passed
+1 💚shadedjars5m 30spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit226m 39s/patch-unit-hbase-server.txthbase-server in the patch failed.
251m 39s
SubsystemReport/Notes
DockerClientAPI=1.46 ServerAPI=1.46 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux 8c8fd75c39a9 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 69cdb54
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/testReport/
Max. process+thread count4555 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/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 41sDocker mode activated.
-0 ⚠️yetus0m 6sUnprocessed 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 💚mvninstall2m 53sbranch-2 passed
+1 💚compile0m 53sbranch-2 passed
+1 💚javadoc0m 27sbranch-2 passed
+1 💚shadedjars5m 32sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 0sthe patch passed
+1 💚compile0m 52sthe patch passed
+1 💚javac0m 52sthe patch passed
+1 💚javadoc0m 27sthe patch passed
+1 💚shadedjars5m 31spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit241m 5s/patch-unit-hbase-server.txthbase-server in the patch failed.
265m 54s
SubsystemReport/Notes
DockerClientAPI=1.46 ServerAPI=1.46 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux afb5001c2226 5.4.0-186-generic #206-Ubuntu SMP Fri Apr 26 12:31:10 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 69cdb54
Default JavaEclipse Adoptium-11.0.23+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/2/testReport/
Max. process+thread count4403 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/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.

@virajjasani

Copy link
Copy Markdown
Contributor

@Apache9 this is for 2.x versions. Would you like to take a look?

@Apache9

Copy link
Copy Markdown
Contributor

Mind explaining more here? The old logic seems correct, only if there are no un flushed entries, we can clean the WAL file...

@kiran-maturi

kiran-maturi commented Aug 29, 2024

Copy link
Copy Markdown
ContributorAuthor

@Apache9 I have observed in production WAL files not being cleaned for days from the roll over. This was due to the WALs not being marked for close when they had unflushed entries.

if (!isUnflushedEntries()) {
markClosedAndClean(oldPath);
}

During clean up in cleanOldLogs

if (!e.getValue().closed) {
LOG.debug("{} is not closed yet, will try archiving it next time", e.getKey());
continue;
}

The above log line was emitted for wal files that were rolled over days ago. Once its not marked close we will not be able to clean up there by leading lot of files to be processed during SCP .
The current change marks it close. The WAL file won't be cleaned as there is check to make sure all the entries related to WAL have been flushed

Map<byte[], Long> sequenceNums = e.getValue().encodedName2HighestSequenceId;
if (this.sequenceIdAccounting.areAllLower(sequenceNums)) {
if (logsToArchive == null) {
logsToArchive = new ArrayList<>();
}
logsToArchive.add(Pair.newPair(log, e.getValue().logSize));
if (LOG.isTraceEnabled()) {
LOG.trace("WAL file ready for archiving " + log);
}
}

My understanding is it is safe to mark them closed even with unflushed entries as there is check in cleanup which will not let the wal file to be cleaned up.

@Apache9

Copy link
Copy Markdown
Contributor

What I mean is that, the logic here is correct, so in general, if everything works as expected, you can not archive the file, even if you mark it as closed right? The later sequence id check should prevent you from deleting the file.

If not, as you described here, the WAL file can be deleted after you mark it as closed, then there must be something wrong, as there is some unflushed entries but the sequence id accounting tells us there is nothing unflushed?

Thanks.

@kiran-maturi

kiran-maturi commented Aug 29, 2024

Copy link
Copy Markdown
ContributorAuthor

@Apache9 Lets consider this scenario
At T1 wal roll over happend for WAL1 and new WAL2 has been created there are unflushed entries on the ring buffer at T1 ( highestUnsynced - highestSynced)
at T1 check sequenceId accounting for regions will also show the same there are unflushed entries for some region (this.sequenceIdAccounting.areAllLower(sequenceNums))
at T2 WAL2 gets rolled over
At T2 all the entries for WAL1 should have been flushed and we should be good to clean it up when cleanOldLogs is called
(this.sequenceIdAccounting.areAllLower(sequenceNums))
but we won't be able to clean it up as we have not marked it close
T2 - T1 > 10 mins

@kiran-maturi

Copy link
Copy Markdown
ContributorAuthor

@Apache9 can you please review

@Apache9

Copy link
Copy Markdown
Contributor

So this is a problem when refactoring? IIRC we abstract some common logic to AbstractFSWAL on branch-2, but the implementation is still a bit different from master and branch-3.

We need to check the refactoring patch to see if it changed some semantics...

@Apache9

Copy link
Copy Markdown
Contributor

OK, in the old time, if there are unflushed entries, we will throw IOException out and abort the region server...

When optimizing the close logic, we finally changed the code to the current situation.

I think the intention here is that, if there are still unflushed entries after closing writer, there should be an exception thrown out which aborts the region server.

But looking at the implementation of getUnflushedEntriesCount, since we do not block others threads from adding new entries to the ring buffer, the getUnflushedEntriesCount could be greater than 0 even if there are no errors, so I think we need to take a look at the whole logic again, the isUnflushedEntries is not what we want now I'm afraid...

} finally {
// closing this as there is no other chance we can set close to true
// during clean up we check for unflushed entries
markClosedAndClean(oldPath);

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.

Take a look at the code again, the isUnflushedEntries should work as expected. The highestUnsyncedTxid will only be increased in appendEntry method, so in the doReplaceWriter, after arriving the safe point, the highestUnsyncedTxid will not be changed.

I think there is another problem that in closeWriter, we will also check isUnflushedEntries and also increase the closeErrorCount, which may affect the logic here. But for normal case, closeWriter is executed in a background thread pool, so it is not safe to call isUnflushedEntries as it does not reflect the real state before closing... And why we put the close in background is that, even if it fails, it is not a big deal as we can make sure that all entries have already been flushed, a close failure only means we may fail to write the trailer.

I think here, we should only increase the closeErrorCount when closing in foreground, and also, when calling closeWriter, we should pass the result of isUnflushedEntries in, instead of calling it everytime when we want to check this state.

@kiran-maturikiran-maturiSep 9, 2024

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.

@Apache9 Thanks for reviewing.

The highestUnsyncedTxid will only be increased in appendEntry method, so in the doReplaceWriter, after arriving the safe point, the highestUnsyncedTxid will not be changed.

Is it safe to assume that the other threads (calling appendWrite) won't increment highestUnsyncedTxid till the close happens

I think here, we should only increase the closeErrorCount when closing in foreground, and also, when calling closeWriter, we should pass the result of isUnflushedEntries in, instead of calling it everytime when we want to check this state.

Yes that is correct accessing in the isUnflushedEntries in the background will cause issues

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.

Do you plan to fix the background close issue or you just want to add some logs in this issue and file new issues for addressing the background close issue?

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeLogfileComment
+0 🆗reexec0m 43sDocker 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 💚mvninstall3m 21sbranch-2 passed
+1 💚compile3m 1sbranch-2 passed
+1 💚checkstyle0m 39sbranch-2 passed
+1 💚spotbugs1m 38sbranch-2 passed
+1 💚spotless0m 50sbranch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚mvninstall3m 11sthe patch passed
+1 💚compile3m 2sthe patch passed
+1 💚javac3m 2sthe patch passed
+1 💚blanks0m 0sThe patch has no blanks issues.
+1 💚checkstyle0m 37sthe patch passed
+1 💚spotbugs1m 44sthe patch passed
+1 💚hadoopcheck17m 0sPatch does not cause any errors with Hadoop 2.10.2 or 3.3.6 3.4.0.
+1 💚spotless0m 46spatch has no errors when running spotless:check.
_ Other Tests _
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
38m 32s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#6179
Optional Testsdupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
unameLinux 07e61a1813b3 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 / 17ce08c
Default JavaEclipse Adoptium-11.0.23+9
Max. process+thread count78 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/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 🆗reexec4m 5sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed 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 0sbranch-2 passed
+1 💚compile0m 53sbranch-2 passed
+1 💚javadoc0m 28sbranch-2 passed
+1 💚shadedjars5m 30sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 2sthe patch passed
+1 💚compile0m 52sthe patch passed
+1 💚javac0m 52sthe patch passed
+1 💚javadoc0m 28sthe patch passed
+1 💚shadedjars5m 28spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
-1 ❌unit240m 36s/patch-unit-hbase-server.txthbase-server in the patch failed.
269m 3s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux ac319b866957 5.4.0-186-generic #206-Ubuntu SMP Fri Apr 26 12:31:10 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 17ce08c
Default JavaEclipse Adoptium-11.0.23+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/testReport/
Max. process+thread count4375 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/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 🆗reexec3m 31sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed 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 0sbranch-2 passed
+1 💚compile0m 58sbranch-2 passed
+1 💚javadoc0m 30sbranch-2 passed
+1 💚shadedjars5m 27sbranch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚mvninstall3m 5sthe patch passed
+1 💚compile0m 57sthe patch passed
+1 💚javac0m 57sthe patch passed
+1 💚javadoc0m 29sthe patch passed
+1 💚shadedjars5m 26spatch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚unit242m 45shbase-server in the patch passed.
270m 58s
SubsystemReport/Notes
DockerClientAPI=1.47 ServerAPI=1.47 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR#6179
Optional Testsjavac javadoc unit compile shadedjars
unameLinux b715a7143e2a 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2 / 17ce08c
Default JavaEclipse Adoptium-17.0.11+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/testReport/
Max. process+thread count4164 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6179/3/console
versionsgit=2.34.1 maven=3.9.8
Powered byApache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

if (!isUnflushedEntries()) {
markClosedAndClean(oldPath);
} else {
LOG.debug("WAL has unflushed entries path: " + oldPath);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should you add some metrics to track this event? Is this PR about adding logs to help debugging? is there more to the fix?

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.

5 participants

@kiran-maturi@Apache-HBase@virajjasani@Apache9@ranganathg