Skip to content

HBASE-25955 Setting NAMESPACES when adding a replication peer still requires scope definition at CF level - #4052

Open
wchevreuil wants to merge 3 commits into
apache:masterfrom
wchevreuil:HBASE-25955-V2
Open

HBASE-25955 Setting NAMESPACES when adding a replication peer still requires scope definition at CF level#4052
wchevreuil wants to merge 3 commits into
apache:masterfrom
wchevreuil:HBASE-25955-V2

Conversation

@wchevreuil

Copy link
Copy Markdown
Contributor

As mentioned on the jira description, setting either NAMESPACES or TABLECFs when calling add_peer still doesn't suffice to allow entries for the related namespaces/tables to be replicated, if those don't have replication scope set to '1' in the CF descriptor.
The above happens because ChainWalEntryFilter, currently, applies conjunction (AND) to all its chained filters. Following suggestions from @anoopsjohn on an previous PR, rather than changing this behaviour completely, this PR introduces an option to define between conjunction (AND) or disjunction (OR) logic for ChainWalEntryFilter, keeping current logic (AND) the default one, if not specified.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 32sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗prototool0m 0sprototool was not available.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for branch
+1 💚mvninstall5m 16smaster passed
+1 💚compile7m 46smaster passed
+1 💚checkstyle2m 14smaster passed
+1 💚spotbugs9m 8smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 16sMaven dependency ordering for patch
+1 💚mvninstall4m 54sthe patch passed
+1 💚compile7m 52sthe patch passed
+1 💚cc7m 52sthe patch passed
+1 💚javac7m 52sthe patch passed
+1 💚checkstyle2m 34sthe patch passed
-0 ⚠️rubocop0m 19sThe patch generated 19 new + 481 unchanged - 5 fixed = 500 total (was 486)
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck26m 4sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚hbaseprotoc3m 2sthe patch passed
+1 💚spotbugs9m 11sthe patch passed
_ Other Tests _
+1 💚asflicense0m 49sThe patch does not generate ASF License warnings.
91m 59s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4052
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool rubocop
unameLinux 12cba21a2a95 4.15.0-161-generic #169-Ubuntu SMP Fri Oct 15 13:41:54 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 1d2b8a0
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count96 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2 rubocop=0.80.0
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 25sDocker 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 16sMaven dependency ordering for branch
+1 💚mvninstall4m 8smaster passed
+1 💚compile2m 42smaster passed
+1 💚shadedjars8m 23sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 33smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for patch
+1 💚mvninstall3m 50sthe patch passed
+1 💚compile2m 40sthe patch passed
+1 💚javac2m 40sthe patch passed
+1 💚shadedjars8m 22spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 29sthe patch passed
_ Other Tests _
+1 💚unit0m 46shbase-protocol-shaded in the patch passed.
+1 💚unit1m 20shbase-client in the patch passed.
+1 💚unit147m 32shbase-server in the patch passed.
+1 💚unit7m 24shbase-shell in the patch passed.
194m 14s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4052
Optional Testsjavac javadoc unit shadedjars compile
unameLinux e87ae0bc4181 4.15.0-156-generic #163-Ubuntu SMP Thu Aug 19 23:31:58 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 1d2b8a0
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count4967 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versionsgit=2.17.1 maven=3.6.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 🆗reexec1m 16sDocker 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 19sMaven dependency ordering for branch
+1 💚mvninstall5m 1smaster passed
+1 💚compile3m 28smaster passed
+1 💚shadedjars8m 50sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 46smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 18sMaven dependency ordering for patch
+1 💚mvninstall4m 50sthe patch passed
+1 💚compile3m 23sthe patch passed
+1 💚javac3m 23sthe patch passed
+1 💚shadedjars8m 44spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 44sthe patch passed
_ Other Tests _
+1 💚unit1m 7shbase-protocol-shaded in the patch passed.
+1 💚unit1m 32shbase-client in the patch passed.
-1 ❌unit148m 55shbase-server in the patch failed.
+1 💚unit7m 34shbase-shell in the patch passed.
201m 50s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4052
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 4f4dd5837a0b 4.15.0-112-generic #113-Ubuntu SMP Thu Jul 9 23:41:39 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 1d2b8a0
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-server.txt
Test Resultshttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count4098 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console outputhttps://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@wchevreuil

Copy link
Copy Markdown
ContributorAuthor

TestFromClientSide5 pass locally for me. Flakey?

@joshelserjoshelser left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Turns out I had some pending comments I never published: sorry. This is filling in a nice gap. It would be good to make sure we get a clear exception server-side and via Java API. Rest of the stuff is "nice to have".

Comment threadhbase-shell/src/main/ruby/hbase/replication_admin.rb Outdated
Comment on lines +37 to +38
An optional parameter for the boolean operator to be applied over different WAL Entry filters. If
omitted, conjunction (AND) is applied.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm wondering if, through the shell, we should provide some more simplicity for the operator. They are unaware of any of the WALFilters that we are setting behind the scenes. To them, this operator would be nothing more than a "magic word" (e.g. "I put 'OR' and then my data gets replicated"). I guess it's better to get this code committed and then think about ways to make it more clear to admins.

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.

Indeed this ended up too "programming oriented". Maybe we could change to a more meaningful boolean property, such as: "PASS_ONE_FILTER_ONLY"?

peer.getTableCfsList().toArray(new ReplicationProtos.TableCF[peer.getTableCfsCount()]));
if (tableCFsMap != null) {
builder.setTableCFsMap(tableCFsMap);
builder.setChainedFiltersOperation(peer.getChainOperator());

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should apply validation here (in addition to or instead of Ruby) as the Java API to set the chainOperator as a user could be writing Java code directly instead of writing Ruby code to interact with HBase.

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.

We could add some validation here, but none of the other already existing fields are doing much validation either. An invalid value would fail the addPeer operation later on ChainWALEntryFilter constructor, as the enum "valueOf" call would raise an exception.

public ChainWALEntryFilter(List<WALEntryFilter> filters, String operatorName) {
this(filters);
if (!StringUtils.isEmpty(operatorName)) {
this.operator = Operator.valueOf(operatorName);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was trying to figure out the first place we read the String "operatorName" and make sure it fails gracefully.

I know you have the client-side checking in Ruby code, and I suggested we have Java data validation. We should check it here as future-proofing. I think this happens early enough in the replication setup that the client would see a RemoteException flowing back to them? (not that their add_peer call would succeed and just not replicate any data because it failed).

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.

You mean, beyond the checks to avoid an NPE, explicitly extra check for the valid strings and throw IllegalArgumentException, rather than letting the enum error?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, something that we would at least throw back a well-formed exception (and not something that might be very terse/short)

wchevreuiland others added 2 commits March 21, 2022 14:46
Co-authored-by: Josh Elser <josh.elser@gmail.com>
…/NamespaceTableCfWALEntryFilter.java
Co-authored-by: Josh Elser <josh.elser@gmail.com>
@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 28sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+0 🆗prototool0m 0sprototool was not available.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for branch
+1 💚mvninstall3m 9smaster passed
+1 💚compile5m 30smaster passed
+1 💚checkstyle1m 25smaster passed
+1 💚spotbugs7m 4smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall2m 56sthe patch passed
+1 💚compile5m 2sthe patch passed
+1 💚cc5m 2sthe patch passed
+1 💚javac5m 2sthe patch passed
+1 💚checkstyle1m 26sthe patch passed
-0 ⚠️rubocop0m 12sThe patch generated 19 new + 481 unchanged - 5 fixed = 500 total (was 486)
+1 💚whitespace0m 1sThe patch has no whitespace issues.
+1 💚hadoopcheck14m 39sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚hbaseprotoc1m 39sthe patch passed
+1 💚spotbugs6m 23sthe patch passed
_ Other Tests _
+1 💚asflicense0m 29sThe patch does not generate ASF License warnings.
57m 22s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4052
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool rubocop
unameLinux ffe0c23e1c73 5.4.0-96-generic #109-Ubuntu SMP Wed Jan 12 16:49:16 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f78f232
Default JavaAdoptOpenJDK-1.8.0_282-b08
rubocophttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-general-check/output/diff-patch-rubocop.txt
Max. process+thread count60 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2 rubocop=0.80.0
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 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 16sMaven dependency ordering for branch
+1 💚mvninstall2m 19smaster passed
+1 💚compile1m 24smaster passed
+1 💚shadedjars3m 47sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 50smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 10sMaven dependency ordering for patch
+1 💚mvninstall2m 6sthe patch passed
+1 💚compile1m 24sthe patch passed
+1 💚javac1m 24sthe patch passed
+1 💚shadedjars3m 48spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 48sthe patch passed
_ Other Tests _
+1 💚unit0m 24shbase-protocol-shaded in the patch passed.
+1 💚unit1m 9shbase-client in the patch passed.
-1 ❌unit170m 25shbase-server in the patch failed.
-1 ❌unit7m 31shbase-shell in the patch failed.
198m 40s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4052
Optional Testsjavac javadoc unit shadedjars compile
unameLinux f4a5b98635de 5.4.0-1025-aws #25~18.04.1-Ubuntu SMP Fri Sep 11 12:03:04 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f78f232
Default JavaAdoptOpenJDK-1.8.0_282-b08
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-shell.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count2782 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versionsgit=2.17.1 maven=3.6.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 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 16sMaven dependency ordering for branch
+1 💚mvninstall3m 54smaster passed
+1 💚compile2m 35smaster passed
+1 💚shadedjars4m 58sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 26smaster passed
_ Patch Compile Tests _
+0 🆗mvndep0m 12sMaven dependency ordering for patch
+1 💚mvninstall3m 42sthe patch passed
+1 💚compile2m 25sthe patch passed
+1 💚javac2m 25sthe patch passed
+1 💚shadedjars5m 4spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc1m 25sthe patch passed
_ Other Tests _
+1 💚unit0m 55shbase-protocol-shaded in the patch passed.
+1 💚unit2m 10shbase-client in the patch passed.
+1 💚unit233m 57shbase-server in the patch passed.
-1 ❌unit9m 4shbase-shell in the patch failed.
276m 10s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4052
Optional Testsjavac javadoc unit shadedjars compile
unameLinux f97c52aff568 5.4.0-1043-aws #45~18.04.1-Ubuntu SMP Fri Apr 9 23:32:25 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f78f232
Default JavaAdoptOpenJDK-11.0.10+9
unithttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk11-hadoop3-check/output/patch-unit-hbase-shell.txt
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count2703 (vs. ulimit of 30000)
modulesC: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

peer.getTableCfsList().toArray(new ReplicationProtos.TableCF[peer.getTableCfsCount()]));
if (tableCFsMap != null) {
builder.setTableCFsMap(tableCFsMap);
builder.setChainedFiltersOperation(peer.getChainOperator());

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.

I do not think this is a good name? The chain filter is an internal implementation in HBase, maybe in the future we could change the implementation to not use a filter...

Maybe just name it overrideReplicationScope or something similar?

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@wchevreuil@Apache-HBase@joshelser@Apache9