Skip to content

HBASE-27621 Also clear the Dictionary when resetting when reading compressed WAL file - #5016

Merged
Apache9 merged 1 commit into
apache:masterfrom
Apache9:HBASE-27621
Feb 11, 2023
Merged

HBASE-27621 Also clear the Dictionary when resetting when reading compressed WAL file#5016
Apache9 merged 1 commit into
apache:masterfrom
Apache9:HBASE-27621

Conversation

@Apache9

@Apache9Apache9 commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

No description provided.

@Apache9Apache9 self-assigned this Feb 8, 2023
@thangTang

Copy link
Copy Markdown
Contributor

This seems like an ingenious idea. But I want to confirm that due to the eviction mechanism of LRUMap, even if findEntry is used instead of addEntry, is there still a possibility of inconsistent read-write path behavior in theory?

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 21sDocker 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.
_ master Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall5m 12smaster passed
+1 💚compile3m 33smaster passed
+1 💚checkstyle0m 55smaster passed
+1 💚spotless0m 46sbranch has no errors when running spotless:check.
+1 💚spotbugs2m 54smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall4m 34sthe patch passed
+1 💚compile3m 19sthe patch passed
+1 💚javac3m 19sthe patch passed
+1 💚checkstyle0m 15sThe patch passed checkstyle in hbase-common
+1 💚checkstyle0m 36shbase-server: The patch generated 0 new + 5 unchanged - 2 fixed = 5 total (was 7)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck20m 14sPatch does not cause any errors with Hadoop 3.2.4 3.3.4.
+1 💚spotless0m 57spatch has no errors when running spotless:check.
+1 💚spotbugs3m 10sthe patch passed
_ Other Tests _
+1 💚asflicense0m 20sThe patch does not generate ASF License warnings.
59m 6s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5016
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 0655804e6aa8 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 1a9e465
Default JavaEclipse Adoptium-11.0.17+8
Max. process+thread count84 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/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.

offset = Bytes.putAsShort(dest, offset, tagLen);
IOUtils.readFully(src, dest, offset, tagLen);
tagDict.addEntry(dest, offset, tagLen);
tagDict.findEntry(dest, offset, tagLen);

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 think this change could be expensive? In the normal case, the entry will not exist in the dict. But now we're adding an extra map lookup for every call. Granted o(1), but involves cpu for hashcode, allocating lookup key, etc.

I wonder if we could trigger findEntry only if context has been reset? Otherwise use addEntry for first pass?

May not be a big issue, just checking

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.

It is slower than before but I always think correctness comes first, and then we consider the performance. For log splitting and replication, reading is usually not the bottleneck.

Can file an follow on issue to do the optimization, maybe we could add a reset flag in CompressionContext too, to indicate that whether we need to do a lookup first.

Thanks.

@bbeaudreaultbbeaudreaultFeb 8, 2023

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.

Sounds good, agree on correctness first.

Also agree on bottleneck for splitting/replications. However, this uncompressTags method is in the hot path of normal reads when DataBlockEncoding is used: here.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec3m 5sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall4m 7smaster passed
+1 💚compile1m 23smaster passed
+1 💚shadedjars5m 25sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 47smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall3m 44sthe patch passed
+1 💚compile0m 55sthe patch passed
+1 💚javac0m 55sthe patch passed
+1 💚shadedjars4m 37spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 34sthe patch passed
_ Other Tests _
+1 💚unit2m 1shbase-common in the patch passed.
-1 ❌unit202m 55shbase-server in the patch failed.
234m 28s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 89a079cfa76f 5.4.0-1094-aws #102~18.04.1-Ubuntu SMP Tue Jan 10 21:07:03 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 1a9e465
Default JavaEclipse Adoptium-11.0.17+8
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/testReport/
Max. process+thread count2668 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/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 🆗reexec1m 19sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall4m 25smaster passed
+1 💚compile1m 10smaster passed
+1 💚shadedjars5m 8sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 49smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall4m 10sthe patch passed
+1 💚compile1m 16sthe patch passed
+1 💚javac1m 16sthe patch passed
+1 💚shadedjars5m 15spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 46sthe patch passed
_ Other Tests _
+1 💚unit2m 19shbase-common in the patch passed.
-1 ❌unit215m 9shbase-server in the patch failed.
247m 1s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 099dc80b3993 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 1a9e465
Default JavaTemurin-1.8.0_352-b08
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/1/testReport/
Max. process+thread count2338 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/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.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

This seems like an ingenious idea. But I want to confirm that due to the eviction mechanism of LRUMap, even if findEntry is used instead of addEntry, is there still a possibility of inconsistent read-write path behavior in theory?

The most important thing here is to read WAL entries in order, and not skip any entries. If these two rules are guaranteed, it is OK to restart as many times as you want. And I think for replication, we must follow these two rules otherwise there will be data loss...

@thangTang

thangTang commented Feb 8, 2023

Copy link
Copy Markdown
Contributor

This seems like an ingenious idea. But I want to confirm that due to the eviction mechanism of LRUMap, even if findEntry is used instead of addEntry, is there still a possibility of inconsistent read-write path behavior in theory?

The most important thing here is to read WAL entries in order, and not skip any entries. If these two rules are guaranteed, it is OK to restart as many times as you want. And I think for replication, we must follow these two rules otherwise there will be data loss...

Agree about that, but I think I didn't express my question clearly.

For WAL Compression, The core logic is to build an index (LRUMap) in memory while writing/reading WAL. There is another key point here, that is, when operating a WAL file, the behavior of both read/write path needs to be exactly same.

Using findEntry instead of addEntry in this patch, I think it could solve a part of problem. But however, for example, we did not resetPosition when we wrote WAL, but a certain position was reset many times when we read WAL. The implicit operation here is: this node has been movedToHead many times in LRUMap. So is it possible that the node evicted in the write path(write WAL) has inconsistencies in the read path(replication)?

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 25sDocker 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.
_ master Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for branch
+1 💚mvninstall3m 30smaster passed
+1 💚compile2m 55smaster passed
+1 💚checkstyle0m 43smaster passed
+1 💚spotless0m 40sbranch has no errors when running spotless:check.
+1 💚spotbugs1m 56smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall3m 13sthe patch passed
+1 💚compile2m 51sthe patch passed
+1 💚javac2m 51sthe patch passed
+1 💚checkstyle0m 12sThe patch passed checkstyle in hbase-common
+1 💚checkstyle0m 31shbase-server: The patch generated 0 new + 5 unchanged - 2 fixed = 5 total (was 7)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck12m 43sPatch does not cause any errors with Hadoop 3.2.4 3.3.4.
+1 💚spotless0m 38spatch has no errors when running spotless:check.
+1 💚spotbugs2m 3sthe patch passed
_ Other Tests _
+1 💚asflicense0m 16sThe patch does not generate ASF License warnings.
40m 45s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5016
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux af035ff80124 5.4.0-1094-aws #102~18.04.1-Ubuntu SMP Tue Jan 10 21:07:03 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6a34aa8
Default JavaEclipse Adoptium-11.0.17+8
Max. process+thread count86 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/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 26sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall3m 22smaster passed
+1 💚compile0m 57smaster passed
+1 💚shadedjars4m 36sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 35smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 16sthe patch passed
+1 💚compile0m 56sthe patch passed
+1 💚javac0m 56sthe patch passed
+1 💚shadedjars4m 34spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 35sthe patch passed
_ Other Tests _
+1 💚unit1m 58shbase-common in the patch passed.
+1 💚unit204m 47shbase-server in the patch passed.
230m 42s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 685adc51353b 5.4.0-1094-aws #102~18.04.1-Ubuntu SMP Tue Jan 10 21:07:03 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6a34aa8
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/2/testReport/
Max. process+thread count2707 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/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 49sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for branch
+1 💚mvninstall2m 45smaster passed
+1 💚compile0m 56smaster passed
+1 💚shadedjars4m 15sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 39smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall2m 49sthe patch passed
+1 💚compile0m 58sthe patch passed
+1 💚javac0m 58sthe patch passed
+1 💚shadedjars4m 17spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 37sthe patch passed
_ Other Tests _
+1 💚unit1m 48shbase-common in the patch passed.
+1 💚unit209m 56shbase-server in the patch passed.
234m 51s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 8b13800be3c3 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6a34aa8
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/2/testReport/
Max. process+thread count2387 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/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 🆗reexec1m 12sDocker 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.
_ master Compile Tests _
+0 🆗mvndep0m 14sMaven dependency ordering for branch
+1 💚mvninstall5m 19smaster passed
+1 💚compile3m 41smaster passed
+1 💚checkstyle0m 58smaster passed
+1 💚spotless0m 46sbranch has no errors when running spotless:check.
+1 💚spotbugs2m 55smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 9sMaven dependency ordering for patch
+1 💚mvninstall4m 41sthe patch passed
+1 💚compile3m 17sthe patch passed
+1 💚javac3m 17sthe patch passed
+1 💚checkstyle0m 13sThe patch passed checkstyle in hbase-common
+1 💚checkstyle0m 43shbase-server: The patch generated 0 new + 5 unchanged - 2 fixed = 5 total (was 7)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck19m 58sPatch does not cause any errors with Hadoop 3.2.4 3.3.4.
+1 💚spotless0m 55spatch has no errors when running spotless:check.
+1 💚spotbugs3m 11sthe patch passed
_ Other Tests _
+1 💚asflicense0m 21sThe patch does not generate ASF License warnings.
58m 38s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5016
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux 3f1e83ca043a 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6a34aa8
Default JavaEclipse Adoptium-11.0.17+8
Max. process+thread count86 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/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 🆗reexec4m 39sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 56smaster passed
+1 💚compile1m 6smaster passed
+1 💚shadedjars4m 38sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 42smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall3m 33sthe patch passed
+1 💚compile1m 7sthe patch passed
+1 💚javac1m 7sthe patch passed
+1 💚shadedjars4m 33spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 40sthe patch passed
_ Other Tests _
+1 💚unit2m 15shbase-common in the patch passed.
+1 💚unit209m 12shbase-server in the patch passed.
240m 56s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 6d7399d360d4 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6a34aa8
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/testReport/
Max. process+thread count2638 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/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 🆗reexec1m 14sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for branch
+1 💚mvninstall4m 37smaster passed
+1 💚compile1m 7smaster passed
+1 💚shadedjars5m 13sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 49smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall4m 9sthe patch passed
+1 💚compile1m 14sthe patch passed
+1 💚javac1m 14sthe patch passed
+1 💚shadedjars5m 17spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 38sthe patch passed
_ Other Tests _
+1 💚unit2m 17shbase-common in the patch passed.
+1 💚unit214m 48shbase-server in the patch passed.
246m 17s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 6a2964fb26a9 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 6a34aa8
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/testReport/
Max. process+thread count2462 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/3/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

This seems like an ingenious idea. But I want to confirm that due to the eviction mechanism of LRUMap, even if findEntry is used instead of addEntry, is there still a possibility of inconsistent read-write path behavior in theory?

The most important thing here is to read WAL entries in order, and not skip any entries. If these two rules are guaranteed, it is OK to restart as many times as you want. And I think for replication, we must follow these two rules otherwise there will be data loss...

Agree about that, but I think I didn't express my question clearly.

For WAL Compression, The core logic is to build an index (LRUMap) in memory while writing/reading WAL. There is another key point here, that is, when operating a WAL file, the behavior of both read/write path needs to be exactly same.

Using findEntry instead of addEntry in this patch, I think it could solve a part of problem. But however, for example, we did not resetPosition when we wrote WAL, but a certain position was reset many times when we read WAL. The implicit operation here is: this node has been movedToHead many times in LRUMap. So is it possible that the node evicted in the write path(write WAL) has inconsistencies in the read path(replication)?

After deep consideration I think you are right. The solution here can only work perfectly when the dict is infinite, i.e, no eviction. If we also consider eviction, if go back for a long distance, the word of a given index will change due to eviction, then when reading, if we use a index to get the word(a qualifier, a row, for example), we may get a incorrect word on the given index.
In real world, although it is not likely that we will go back for a very long distance, but it is possible that a single WAL entry has a lot of cells, and our qualifier dict capacity is only 127, it is still possible to fall into the above scenario...

So, it seems that rebuilding the dict is necessary when reseting. But anyway, I could try to refactor the readNext method in ProtrobufLogReader, to have more fine-grained control on whether we need to reconstruct the dict. For example, if we just return before reading the actual WAL entry, i.e, we quit earlier after checking available bytes, we do not need to reconstruct the dict.

Thanks for pointing this out!

@thangTang

Copy link
Copy Markdown
Contributor

So, it seems that rebuilding the dict is necessary when reseting.

Agree. Although this solution will have a performance loss, but it should be the best way I can think of to completely solve this problem.
Another idea is to refactor dict and design an LRUMap that can support precise rollback. I've spent some time in this direction, but found nothing out. At least, it also can't be free (such as memory overhead). . .

@Apache9
Apache9 marked this pull request as draft February 9, 2023 07:31
@Apache9

Copy link
Copy Markdown
ContributorAuthor

The PR can not solve all the problem so I convert it to draft to avoid others may merge it accidentally.

Thanks all for help reviewing and testing, especially @thangTang for pointing out the problem.

Will change the title and provide a new PR soon.

@sunhelly

Copy link
Copy Markdown
Contributor

For ensure the compress and uncompress construct same dictionary, we should only use LRUDictionary#findEntry() to add entries, but need to keep LRUDictionary#getEntry() do not move ahead the entry?

@Apache9

Copy link
Copy Markdown
ContributorAuthor

For ensure the compress and uncompress construct same dictionary, we should only use LRUDictionary#findEntry() to add entries, but need to keep LRUDictionary#getEntry() do not move ahead the entry?

This is still not enough... As said above, if we go back for a long distance, the word on a given index could be completely different, and then lead to incorrect result when you find a field is 'in dictionary'...

@Apache9

Copy link
Copy Markdown
ContributorAuthor

I tried to refactoring a bit but the implementation of ProtobufLogReader is too complicated. I think we'd better abstract two types of WAL.Reader for reading WAL file.
One is StreamingReader, which is used in most cases, for example, WAL splitting, WAL printing, etc, where we only need to read the file once and usually for closed WAL files. There is no need to support reset and seek.
The other is TailingReader, which is used by Replication, where we need to support reset and seek, and also we need to tell the upper layer whether we need to reset the compress context when calling reseting. The logic will be more complicated as we need to consider the requirements for tailing a WAL file which is currently being written.
The refactoring will be a bit big so I do not think we should apply it to branch-2.5 and branch-2.4. So let's apply the simple fix here and file another issue to implement the big refactoring.

Thanks.

@thangTang

Copy link
Copy Markdown
Contributor

I tried to refactoring a bit but the implementation of ProtobufLogReader is too complicated. I think we'd better abstract two types of WAL.Reader for reading WAL file. One is StreamingReader, which is used in most cases, for example, WAL splitting, WAL printing, etc, where we only need to read the file once and usually for closed WAL files. There is no need to support reset and seek. The other is TailingReader, which is used by Replication, where we need to support reset and seek, and also we need to tell the upper layer whether we need to reset the compress context when calling reseting. The logic will be more complicated as we need to consider the requirements for tailing a WAL file which is currently being written. The refactoring will be a bit big so I do not think we should apply it to branch-2.5 and branch-2.4. So let's apply the simple fix here and file another issue to implement the big refactoring.

Thanks.

I understand that this is a complicated and dirty job, I am ashamed that I didn't solve it thoroughly before...
But by the way, just for this PR, Would you mind taking a look at https://issues.apache.org/jira/browse/HBASE-26850 and #4233?
At that time, I thought that it could not fundamentally solve the problem, so I did not continue to push forward, but these two patches seem a bit similar? The difference is that I changed the implementation of addEntry.

@thangTang

Copy link
Copy Markdown
Contributor

@apurtell FYI, I think you may also be interested in this patch~

@thangTang

Copy link
Copy Markdown
Contributor

After all, manual +1 from me: )

@Apache9
Apache9 marked this pull request as ready for review February 9, 2023 15:17
@Apache9Apache9 changed the title HBASE-27621 Always use findEntry to fill the Dictionary when reading …HBASE-27621 Also clear the Dictionary when resetting when reading compressed WAL fileFeb 9, 2023
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 24sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 31smaster passed
+1 💚compile0m 56smaster passed
+1 💚shadedjars4m 36sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 36smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 15sthe patch passed
+1 💚compile0m 56sthe patch passed
+1 💚javac0m 56sthe patch passed
+1 💚shadedjars4m 35spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 33sthe patch passed
_ Other Tests _
+1 💚unit2m 0shbase-common in the patch passed.
+1 💚unit197m 53shbase-server in the patch passed.
224m 25s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/4/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 8f57a4aad181 5.4.0-1093-aws #102~18.04.2-Ubuntu SMP Wed Dec 7 00:31:59 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a854cba
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/4/testReport/
Max. process+thread count2493 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/4/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 46sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall2m 45smaster passed
+1 💚compile0m 55smaster passed
+1 💚shadedjars4m 16sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 37smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 13sMaven dependency ordering for patch
+1 💚mvninstall2m 53sthe patch passed
+1 💚compile0m 56sthe patch passed
+1 💚javac0m 56sthe patch passed
+1 💚shadedjars4m 15spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 38sthe patch passed
_ Other Tests _
+1 💚unit1m 45shbase-common in the patch passed.
+1 💚unit211m 19shbase-server in the patch passed.
235m 55s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/4/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 32aa9c6efaca 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a854cba
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/4/testReport/
Max. process+thread count2250 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/4/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

I tried to refactoring a bit but the implementation of ProtobufLogReader is too complicated. I think we'd better abstract two types of WAL.Reader for reading WAL file. One is StreamingReader, which is used in most cases, for example, WAL splitting, WAL printing, etc, where we only need to read the file once and usually for closed WAL files. There is no need to support reset and seek. The other is TailingReader, which is used by Replication, where we need to support reset and seek, and also we need to tell the upper layer whether we need to reset the compress context when calling reseting. The logic will be more complicated as we need to consider the requirements for tailing a WAL file which is currently being written. The refactoring will be a bit big so I do not think we should apply it to branch-2.5 and branch-2.4. So let's apply the simple fix here and file another issue to implement the big refactoring.
Thanks.

I understand that this is a complicated and dirty job, I am ashamed that I didn't solve it thoroughly before... But by the way, just for this PR, Would you mind taking a look at https://issues.apache.org/jira/browse/HBASE-26850 and #4233? At that time, I thought that it could not fundamentally solve the problem, so I did not continue to push forward, but these two patches seem a bit similar? The difference is that I changed the implementation of addEntry.

I think this can be done step by step.
First, we apply the patch here to fix the problem first, where the performance maybe bad than before. And then, we refactor the Reader, to introduce two types of Reader, so we can focus on how to improve the performance of tailing the WAL file which is being written currently in Repliaction without affecting the WAL splitting logic. Then we could try to introduce fine-grained control on whether we should reconstruct the dictionary, and finally, we could try to improve the LRUDictionary to support checkpoint and rollback, and do a checkpoint at a proper place and use rollback instead of clear and reconstruct, to get all the performance back.

WDYT?

Thanks.

@thangTang

Copy link
Copy Markdown
Contributor

I tried to refactoring a bit but the implementation of ProtobufLogReader is too complicated. I think we'd better abstract two types of WAL.Reader for reading WAL file. One is StreamingReader, which is used in most cases, for example, WAL splitting, WAL printing, etc, where we only need to read the file once and usually for closed WAL files. There is no need to support reset and seek. The other is TailingReader, which is used by Replication, where we need to support reset and seek, and also we need to tell the upper layer whether we need to reset the compress context when calling reseting. The logic will be more complicated as we need to consider the requirements for tailing a WAL file which is currently being written. The refactoring will be a bit big so I do not think we should apply it to branch-2.5 and branch-2.4. So let's apply the simple fix here and file another issue to implement the big refactoring.
Thanks.

I understand that this is a complicated and dirty job, I am ashamed that I didn't solve it thoroughly before... But by the way, just for this PR, Would you mind taking a look at https://issues.apache.org/jira/browse/HBASE-26850 and #4233? At that time, I thought that it could not fundamentally solve the problem, so I did not continue to push forward, but these two patches seem a bit similar? The difference is that I changed the implementation of addEntry.

I think this can be done step by step. First, we apply the patch here to fix the problem first, where the performance maybe bad than before. And then, we refactor the Reader, to introduce two types of Reader, so we can focus on how to improve the performance of tailing the WAL file which is being written currently in Repliaction without affecting the WAL splitting logic. Then we could try to introduce fine-grained control on whether we should reconstruct the dictionary, and finally, we could try to improve the LRUDictionary to support checkpoint and rollback, and do a checkpoint at a proper place and use rollback instead of clear and reconstruct, to get all the performance back.

WDYT?

Thanks.

Make sense.
+1 from me.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 23sDocker 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.
_ master Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for branch
+1 💚mvninstall3m 15smaster passed
+1 💚compile2m 52smaster passed
+1 💚checkstyle0m 43smaster passed
+1 💚spotless0m 37sbranch has no errors when running spotless:check.
+1 💚spotbugs1m 46smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall3m 20sthe patch passed
+1 💚compile3m 0sthe patch passed
+1 💚javac3m 0sthe patch passed
+1 💚checkstyle0m 12sThe patch passed checkstyle in hbase-common
+1 💚checkstyle0m 31shbase-server: The patch generated 0 new + 9 unchanged - 2 fixed = 9 total (was 11)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck12m 45sPatch does not cause any errors with Hadoop 3.2.4 3.3.4.
+1 💚spotless0m 37spatch has no errors when running spotless:check.
+1 💚spotbugs2m 3sthe patch passed
_ Other Tests _
+1 💚asflicense0m 14sThe patch does not generate ASF License warnings.
40m 21s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#5016
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti spotless checkstyle compile
unameLinux e86193e8d189 5.4.0-1094-aws #102~18.04.1-Ubuntu SMP Tue Jan 10 21:07:03 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a854cba
Default JavaEclipse Adoptium-11.0.17+8
Max. process+thread count86 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/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.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

@sunhelly Could you please try to see if this PR can also solve your problem?

And is it possible to contribute your replication test case to hbase-it?

Thanks.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 48sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 15sMaven dependency ordering for branch
+1 💚mvninstall2m 48smaster passed
+1 💚compile0m 56smaster passed
+1 💚shadedjars4m 15sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 38smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall2m 46sthe patch passed
+1 💚compile0m 56sthe patch passed
+1 💚javac0m 56sthe patch passed
+1 💚shadedjars4m 18spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 37sthe patch passed
_ Other Tests _
+1 💚unit1m 45shbase-common in the patch passed.
+1 💚unit211m 35shbase-server in the patch passed.
236m 15s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux cd3608f7d3ac 5.4.0-137-generic #154-Ubuntu SMP Thu Jan 5 17:03:22 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a854cba
Default JavaTemurin-1.8.0_352-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/testReport/
Max. process+thread count2345 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/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 58sDocker mode activated.
-0 ⚠️yetus0m 2sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 36smaster passed
+1 💚compile1m 6smaster passed
+1 💚shadedjars4m 34sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 38smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 11sMaven dependency ordering for patch
+1 💚mvninstall3m 36sthe patch passed
+1 💚compile1m 5sthe patch passed
+1 💚javac1m 5sthe patch passed
+1 💚shadedjars4m 35spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 39sthe patch passed
_ Other Tests _
+1 💚unit2m 13shbase-common in the patch passed.
+1 💚unit210m 12shbase-server in the patch passed.
238m 2s
SubsystemReport/Notes
DockerClientAPI=1.42 ServerAPI=1.42 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#5016
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 144cedb192cc 5.4.0-135-generic #152-Ubuntu SMP Wed Nov 23 20:19:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / a854cba
Default JavaEclipse Adoptium-11.0.17+8
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/testReport/
Max. process+thread count2622 (vs. ulimit of 30000)
modulesC: hbase-common hbase-server U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-5016/5/console
versionsgit=2.34.1 maven=3.8.6
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@sunhelly

Copy link
Copy Markdown
Contributor

I tested morning, sadly still something wrong...The problem is focus on one scenario, replicated mostly whole row deletes. It seems should not be relevant to the operation, but I can't find more relevant changes.
We have already reset the compress context to fix the issue in the last months, it resolved most problems and seems more stable than before. But we have one circumstance, the replication always stuck. The senerio is as follows.
There is two-way replications between cluster A and cluster B(both using wal group), A without WAL compression, B with WAL compression, write operations only on A. Now there are many whole row deletes on A, the replication of A->B is OK, the replication of B->A is always stucks, and the stuck is not rare, it is very easy to happen.
I can not reproduce this problem locally until now, maybe it's not relevant to the uncompress progress, maybe something wrong when compress and the WAL is corrupt. I used WALPrettyPrinter to read these WALs, the printer always stopped at the same position for one WAL, and no exceptions output, but the end read position of the printer is in the middle of the WAL.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

I tested morning, sadly still something wrong...The problem is focus on one scenario, replicated mostly whole row deletes. It seems should not be relevant to the operation, but I can't find more relevant changes. We have already reset the compress context to fix the issue in the last months, it resolved most problems and seems more stable than before. But we have one circumstance, the replication always stuck. The senerio is as follows. There is two-way replications between cluster A and cluster B(both using wal group), A without WAL compression, B with WAL compression, write operations only on A. Now there are many whole row deletes on A, the replication of A->B is OK, the replication of B->A is always stucks, and the stuck is not rare, it is very easy to happen. I can not reproduce this problem locally until now, maybe it's not relevant to the uncompress progress, maybe something wrong when compress and the WAL is corrupt. I used WALPrettyPrinter to read these WALs, the printer always stopped at the same position for one WAL, and no exceptions output, but the end read position of the printer is in the middle of the WAL.

If WALPrettyPrinter can not output correct result, I think the problem is not about the replication implementation then, it should be something wrong when writing the WAL file. And I believe it will also make WAL splitting incorrect?

Do you also enabled WAL value compression? Or just the dictionary based compression...

Thanks.

@sunhelly

Copy link
Copy Markdown
Contributor

Yes, I also enabled WAL value compression. I'll check if the stuck recurs after disable it.
And there are no WAL splitting issues until now. Thanks.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

Maybe the problem is that, in replication, we will check whether we have parsed all the bytes. But in WAL splitting, we just return after getting EOF...

@sunhelly

Copy link
Copy Markdown
Contributor

Oh, the cluster B really has lose data issue..

@Apache9

Copy link
Copy Markdown
ContributorAuthor

The stuck still occurs after diabling WAL value compression.

Is it OK for your company to upload the WAL file somewhere? So we can see the content of the WAL file and check what is the problem...

@sunhelly

Copy link
Copy Markdown
Contributor

OK. I'll prepare one.

@sunhelly

Copy link
Copy Markdown
Contributor

It works well after disabling WAL value compress with this fix PR on our cluster. We can reproduce the replication stuck by enable WAL value compression, while the WALPrettyPrinter stops at the middle position without any exceptions. The stuck issue now is not relevant to the dictionary.
Great job! Thanks.

@Apache9

Copy link
Copy Markdown
ContributorAuthor

Thanks @sunhelly for providing the useful feedback.

Let me merge this PR first to solve the dictionary problem.

For replication value compression, seems there are still other bugs and @apurtell also pointed out that there are some tricks in the buffer reuse mechanism, will dig more and file other issues to try to fix.

Thanks.

@Apache9
Apache9 merged commit 833b10e into apache:masterFeb 11, 2023
Apache9 added a commit that referenced this pull request Feb 11, 2023
…pressed WAL file (#5016)
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
(cherry picked from commit 833b10e)
Apache9 added a commit that referenced this pull request Feb 11, 2023
…pressed WAL file (#5016)
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
(cherry picked from commit 833b10e)
Apache9 added a commit that referenced this pull request Feb 11, 2023
…pressed WAL file (#5016)
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
(cherry picked from commit 833b10e)
bbeaudreault pushed a commit to HubSpot/hbase that referenced this pull request Feb 9, 2024
…g when reading compressed WAL file (apache#5016)
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
(cherry picked from commit 833b10e)
vinayakphegde pushed a commit to vinayakphegde/hbase that referenced this pull request Apr 4, 2024
…pressed WAL file (apache#5016)
Signed-off-by: Xiaolin Ha <haxiaolin@apache.org>
(cherry picked from commit 833b10e)
(cherry picked from commit 8df3212)
Change-Id: I469fa5b5a7ba6a41c3b8b28acb57a60f33c27fe9
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

@Apache9@thangTang@Apache-HBase@sunhelly@bbeaudreault