Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

wchevreuil
Copy link
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

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 prototool 0m 0s prototool was not available.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 5m 16s master passed
+1 💚 compile 7m 46s master passed
+1 💚 checkstyle 2m 14s master passed
+1 💚 spotbugs 9m 8s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for patch
+1 💚 mvninstall 4m 54s the patch passed
+1 💚 compile 7m 52s the patch passed
+1 💚 cc 7m 52s the patch passed
+1 💚 javac 7m 52s the patch passed
+1 💚 checkstyle 2m 34s the patch passed
-0 ⚠️ rubocop 0m 19s The patch generated 19 new + 481 unchanged - 5 fixed = 500 total (was 486)
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 26m 4s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 hbaseprotoc 3m 2s the patch passed
+1 💚 spotbugs 9m 11s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 49s The patch does not generate ASF License warnings.
91m 59s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool rubocop
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 1d2b8a0
Default Java AdoptOpenJDK-1.8.0_282-b08
rubocop https://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 count 96 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 25s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 4m 8s master passed
+1 💚 compile 2m 42s master passed
+1 💚 shadedjars 8m 23s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 33s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 18s Maven dependency ordering for patch
+1 💚 mvninstall 3m 50s the patch passed
+1 💚 compile 2m 40s the patch passed
+1 💚 javac 2m 40s the patch passed
+1 💚 shadedjars 8m 22s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 29s the patch passed
_ Other Tests _
+1 💚 unit 0m 46s hbase-protocol-shaded in the patch passed.
+1 💚 unit 1m 20s hbase-client in the patch passed.
+1 💚 unit 147m 32s hbase-server in the patch passed.
+1 💚 unit 7m 24s hbase-shell in the patch passed.
194m 14s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 1d2b8a0
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count 4967 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 16s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 19s Maven dependency ordering for branch
+1 💚 mvninstall 5m 1s master passed
+1 💚 compile 3m 28s master passed
+1 💚 shadedjars 8m 50s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 46s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 18s Maven dependency ordering for patch
+1 💚 mvninstall 4m 50s the patch passed
+1 💚 compile 3m 23s the patch passed
+1 💚 javac 3m 23s the patch passed
+1 💚 shadedjars 8m 44s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 44s the patch passed
_ Other Tests _
+1 💚 unit 1m 7s hbase-protocol-shaded in the patch passed.
+1 💚 unit 1m 32s hbase-client in the patch passed.
-1 ❌ unit 148m 55s hbase-server in the patch failed.
+1 💚 unit 7m 34s hbase-shell in the patch passed.
201m 50s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 1d2b8a0
Default Java AdoptOpenJDK-11.0.10+9
unit https://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 Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count 4098 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@wchevreuil
Copy link
Contributor Author

TestFromClientSide5 pass locally for me. Flakey?

Copy link
Member

@joshelser joshelser left a comment

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".

hbase-shell/src/main/ruby/hbase/replication_admin.rb Outdated Show resolved Hide resolved
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
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
Contributor Author

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"?

@@ -290,12 +290,14 @@ public static ReplicationPeerConfig convert(ReplicationProtos.ReplicationPeer pe
peer.getTableCfsList().toArray(new ReplicationProtos.TableCF[peer.getTableCfsCount()]));
if (tableCFsMap != null) {
builder.setTableCFsMap(tableCFsMap);
builder.setChainedFiltersOperation(peer.getChainOperator());
Copy link
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
Contributor Author

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
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
Contributor Author

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
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)

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 28s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 prototool 0m 0s prototool was not available.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for branch
+1 💚 mvninstall 3m 9s master passed
+1 💚 compile 5m 30s master passed
+1 💚 checkstyle 1m 25s master passed
+1 💚 spotbugs 7m 4s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 2m 56s the patch passed
+1 💚 compile 5m 2s the patch passed
+1 💚 cc 5m 2s the patch passed
+1 💚 javac 5m 2s the patch passed
+1 💚 checkstyle 1m 26s the patch passed
-0 ⚠️ rubocop 0m 12s The patch generated 19 new + 481 unchanged - 5 fixed = 500 total (was 486)
+1 💚 whitespace 0m 1s The patch has no whitespace issues.
+1 💚 hadoopcheck 14m 39s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 hbaseprotoc 1m 39s the patch passed
+1 💚 spotbugs 6m 23s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 29s The patch does not generate ASF License warnings.
57m 22s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile cc hbaseprotoc prototool rubocop
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / f78f232
Default Java AdoptOpenJDK-1.8.0_282-b08
rubocop https://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 count 60 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2 rubocop=0.80.0
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 39s Docker mode activated.
-0 ⚠️ yetus 0m 2s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 2m 19s master passed
+1 💚 compile 1m 24s master passed
+1 💚 shadedjars 3m 47s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 50s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
+1 💚 mvninstall 2m 6s the patch passed
+1 💚 compile 1m 24s the patch passed
+1 💚 javac 1m 24s the patch passed
+1 💚 shadedjars 3m 48s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 48s the patch passed
_ Other Tests _
+1 💚 unit 0m 24s hbase-protocol-shaded in the patch passed.
+1 💚 unit 1m 9s hbase-client in the patch passed.
-1 ❌ unit 170m 25s hbase-server in the patch failed.
-1 ❌ unit 7m 31s hbase-shell in the patch failed.
198m 40s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / f78f232
Default Java AdoptOpenJDK-1.8.0_282-b08
unit https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/artifact/yetus-jdk8-hadoop3-check/output/patch-unit-hbase-server.txt
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count 2782 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 49s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+0 🆗 mvndep 0m 16s Maven dependency ordering for branch
+1 💚 mvninstall 3m 54s master passed
+1 💚 compile 2m 35s master passed
+1 💚 shadedjars 4m 58s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 26s master passed
_ Patch Compile Tests _
+0 🆗 mvndep 0m 12s Maven dependency ordering for patch
+1 💚 mvninstall 3m 42s the patch passed
+1 💚 compile 2m 25s the patch passed
+1 💚 javac 2m 25s the patch passed
+1 💚 shadedjars 5m 4s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 1m 25s the patch passed
_ Other Tests _
+1 💚 unit 0m 55s hbase-protocol-shaded in the patch passed.
+1 💚 unit 2m 10s hbase-client in the patch passed.
+1 💚 unit 233m 57s hbase-server in the patch passed.
-1 ❌ unit 9m 4s hbase-shell in the patch failed.
276m 10s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / f78f232
Default Java AdoptOpenJDK-11.0.10+9
unit https://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 Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/testReport/
Max. process+thread count 2703 (vs. ulimit of 30000)
modules C: hbase-protocol-shaded hbase-client hbase-server hbase-shell U: .
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4052/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@@ -290,12 +290,14 @@ public static ReplicationPeerConfig convert(ReplicationProtos.ReplicationPeer pe
peer.getTableCfsList().toArray(new ReplicationProtos.TableCF[peer.getTableCfsCount()]));
if (tableCFsMap != null) {
builder.setTableCFsMap(tableCFsMap);
builder.setChainedFiltersOperation(peer.getChainOperator());
Copy link
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 free to 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