Skip to content

HBASE-28184 Addendum PR - #5521

Open
shahrs87 wants to merge 2 commits into
apache:branch-2.5from
shahrs87:HBASE-28184-addendum
Open

HBASE-28184 Addendum PR#5521
shahrs87 wants to merge 2 commits into
apache:branch-2.5from
shahrs87:HBASE-28184-addendum

Conversation

@shahrs87

Copy link
Copy Markdown
Contributor

No description provided.

long readerPos = reader.getPosition();
OptionalLong fileLength;
if (logQueue.getQueueSize(walGroupId) > 1) {
if (logQueue.getQueueSize(walGroupId) > 2) {

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.

Checking for less than equal to 2 log files in the queue because it is possible that we are doing this check just when the WAL is rolled and the reader has not read the trailer bytes of the old WAL.

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.

TestBasicWALEntryStreamFSHLog#testCleanClosedWALs is failing in branch-2.5 with the original PR #5505
This test is not failing for master branch. There is lot of code refactor in master/branch-2 compared to branch-2.5.
@Apache9@sunhelly Can you please review? Thank you !

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.

Changing to greater than 2 can fix the failing tests? A bit strange, could you please exlain more on this?

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.

Any updates here?

@shahrs87shahrs87Jan 17, 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.

Any updates here?

@Apache9 Sorry couldn't update this thread in a long time. Got distracted somewhere and it fell off my radar.

Changing to greater than 2 can fix the failing tests? A bit strange, could you please exlain more on this?

Actually changing to greater than 2 fixes the failing test but looks like it is not the right fix.
The test is doing the following:

  1. Creating WAL named wal1
  2. Appending some entries to wal1
  3. Calling entryStream.next to read from wal1
  4. Roll the WAL to wal2
  5. Append some entries to wal2
  6. Call entryStream.next to read from wal2
  7. Test that there are NO uncleanlyClosedLogs metric.

The test is failing at #6 above. When it is calling entryStream.next on wal2, the replication code needs to switch the reader to the new WAL file. During rollWriter, we add it to AbstractFSWAL#inflightWALClosures map and close the old WAL file asynchronously here.

In closeWriter method, we append the trailer to the WAL and then close it.
During the closeWriter execution there will be 2 WALs in the logQueue.
Now in WALEntryStream#next method, after this change, we don't read the file length if logQueue size is greater than 1 and hence WALEntryStream is unaware of the trailer bytes and while switching the wal from wal1 to wal2, it gets the following exception:

2024-01-17T10:05:47,247 DEBUG [Listener at localhost/52964] wal.ProtobufLogReader(447): Encountered a malformed edit, seeking back to last good position in file, from 218 to 210
java.io.EOFException: Invalid PB, EOF? Ignoring; originalPosition=210, currentPosition=218
at org.apache.hadoop.hbase.regionserver.wal.ProtobufLogReader.readNext(ProtobufLogReader.java:376) ~[classes/:?]
at org.apache.hadoop.hbase.regionserver.wal.ReaderBase.next(ReaderBase.java:104) ~[classes/:?]
at org.apache.hadoop.hbase.regionserver.wal.ReaderBase.next(ReaderBase.java:92) ~[classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStream.readNextEntryAndRecordReaderPosition(WALEntryStream.java:259) ~[classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStream.tryAdvanceEntry(WALEntryStream.java:181) ~[classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStream.hasNext(WALEntryStream.java:102) ~[classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStream.peek(WALEntryStream.java:111) ~[classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStream.next(WALEntryStream.java:118) ~[classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase$WALEntryStreamWithRetries.access$001(WALEntryStreamTestBase.java:82) ~[test-classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase$WALEntryStreamWithRetries.lambda$next$0(WALEntryStreamTestBase.java:95) ~[test-classes/:?]
at org.apache.hadoop.hbase.Waiter.waitFor(Waiter.java:184) ~[test-classes/:?]
at org.apache.hadoop.hbase.Waiter.waitFor(Waiter.java:135) ~[test-classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.WALEntryStreamTestBase$WALEntryStreamWithRetries.next(WALEntryStreamTestBase.java:94) ~[test-classes/:?]
at org.apache.hadoop.hbase.replication.regionserver.TestBasicWALEntryStream.testCleanClosedWALs(TestBasicWALEntryStream.java:726) ~[test-classes/:?]

I think I know how to fix.
From PR-5505, we have the below check

 OptionalLong fileLength;
if (logQueue.getQueueSize(walGroupId) > 1) {
fileLength = OptionalLong.empty();
} else {
// if there is only one file in queue, check whether it is still being written to
fileLength = walFileLengthProvider.getLogFileSizeIfBeingWritten(currentPath);
}

Along with checking queue size, we also have to check if the currently replicated WAL is not in AbstractFSWAL#inflightWALClosures map then it is safe to not read the file size.

But currently there is NO way to access AbstractFSWAL object from WALEntryStream. I found one class named WALFileLengthProvider but that is a functional interface and as the name suggests it only provides log file size if that file is currently being written.

@Apache9 Any ideas on how can we expose AbstractFSWAL object to WALEntryStream?

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.

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 Can you please take a look in my prev comment?

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 37sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ branch-2.5 Compile Tests _
+1 💚mvninstall2m 50sbranch-2.5 passed
+1 💚compile2m 20sbranch-2.5 passed
+1 💚checkstyle0m 37sbranch-2.5 passed
+1 💚spotless0m 43sbranch has no errors when running spotless:check.
+1 💚spotbugs1m 29sbranch-2.5 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 37sthe patch passed
+1 💚compile2m 22sthe patch passed
+1 💚javac2m 22sthe patch passed
+1 💚checkstyle0m 37sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck13m 22sPatch does not cause any errors with Hadoop 2.10.2 or 3.2.4 3.3.6.
+1 💚spotless0m 40spatch has no errors when running spotless:check.
+1 💚spotbugs1m 40sthe patch passed
_ Other Tests _
+1 💚asflicense0m 11sThe patch does not generate ASF License warnings.
31m 26s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5521
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 8e29c5cfa8ed 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2.5 / 16703c9
Default JavaEclipse Adoptium-11.0.17+8
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-5521/1/console
versionsgit=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 39sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2.5 Compile Tests _
+1 💚mvninstall3m 5sbranch-2.5 passed
+1 💚compile0m 42sbranch-2.5 passed
+1 💚shadedjars5m 13sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 23sbranch-2.5 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 31sthe patch passed
+1 💚compile0m 41sthe patch passed
+1 💚javac0m 41sthe patch passed
+1 💚shadedjars5m 6spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 21sthe patch passed
_ Other Tests _
+1 💚unit192m 10shbase-server in the patch passed.
214m 42s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5521
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 1bd242a6505a 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.5 / 16703c9
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/testReport/
Max. process+thread count4816 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 43sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2.5 Compile Tests _
+1 💚mvninstall2m 21sbranch-2.5 passed
+1 💚compile0m 39sbranch-2.5 passed
+1 💚shadedjars4m 30sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 25sbranch-2.5 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 12sthe patch passed
+1 💚compile0m 41sthe patch passed
+1 💚javac0m 41sthe patch passed
+1 💚shadedjars4m 30spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 24sthe patch passed
_ Other Tests _
+1 💚unit201m 29shbase-server in the patch passed.
222m 6s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#5521
Optional Testsjavac javadoc unit shadedjars compile
unameLinux bac73d2e8656 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2.5 / 16703c9
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/testReport/
Max. process+thread count3969 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/1/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 36sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ branch-2.5 Compile Tests _
+1 💚mvninstall2m 54sbranch-2.5 passed
+1 💚compile2m 24sbranch-2.5 passed
+1 💚checkstyle0m 37sbranch-2.5 passed
+1 💚spotless0m 43sbranch has no errors when running spotless:check.
+1 💚spotbugs1m 28sbranch-2.5 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 39sthe patch passed
+1 💚compile2m 20sthe patch passed
+1 💚javac2m 20sthe patch passed
+1 💚checkstyle0m 35sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck13m 25sPatch does not cause any errors with Hadoop 2.10.2 or 3.2.4 3.3.6.
+1 💚spotless0m 40spatch has no errors when running spotless:check.
+1 💚spotbugs1m 34sthe patch passed
_ Other Tests _
+1 💚asflicense0m 9sThe patch does not generate ASF License warnings.
31m 37s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5521
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 7ae1ce686c8f 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2.5 / 16703c9
Default JavaEclipse Adoptium-11.0.17+8
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-5521/2/console
versionsgit=2.34.1 maven=3.8.6 spotbugs=4.7.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 39sDocker mode activated.
-0 ⚠️yetus0m 5sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2.5 Compile Tests _
+1 💚mvninstall2m 33sbranch-2.5 passed
+1 💚compile0m 42sbranch-2.5 passed
+1 💚shadedjars5m 9sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 22sbranch-2.5 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 32sthe patch passed
+1 💚compile0m 42sthe patch passed
+1 💚javac0m 42sthe patch passed
+1 💚shadedjars5m 9spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 22sthe patch passed
_ Other Tests _
+1 💚unit192m 19shbase-server in the patch passed.
214m 26s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5521
Optional Testsjavac javadoc unit shadedjars compile
unameLinux aa4e071303cc 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.5 / 16703c9
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/testReport/
Max. process+thread count4689 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 41sDocker mode activated.
-0 ⚠️yetus0m 6sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ branch-2.5 Compile Tests _
+1 💚mvninstall2m 14sbranch-2.5 passed
+1 💚compile0m 41sbranch-2.5 passed
+1 💚shadedjars4m 28sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 23sbranch-2.5 passed
_ Patch Compile Tests _
+1 💚mvninstall2m 14sthe patch passed
+1 💚compile0m 39sthe patch passed
+1 💚javac0m 39sthe patch passed
+1 💚shadedjars4m 29spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 24sthe patch passed
_ Other Tests _
+1 💚unit200m 51shbase-server in the patch passed.
221m 29s
SubsystemReport/Notes
DockerClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/artifact/yetus-jdk8-hadoop2-check/output/Dockerfile
GITHUB PR#5521
Optional Testsjavac javadoc unit shadedjars compile
unameLinux fed2de80d9b9 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionbranch-2.5 / 16703c9
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/testReport/
Max. process+thread count4051 (vs. ulimit of 30000)
modulesC: hbase-server U: hbase-server
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5521/2/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

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.

3 participants

@shahrs87@Apache-HBase@Apache9