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-24628 Region normalizer now respects a rate limit (HMaster chore shutdown NPE ADDENDUM) #2540

Conversation

ndimiduk
Copy link
Member

I think this variable is null for backup masters. initializeZKBasedSystemTrackers only called when a master transitions to active. I don't know why it impacts this test though, as an NPE in the backup master thread should cause the thread to halt.

@@ -1638,7 +1638,9 @@ private void stopChores() {
choreService.cancelChore(this.mobFileCleanerChore);
choreService.cancelChore(this.mobFileCompactionChore);
choreService.cancelChore(this.balancerChore);
choreService.cancelChore(getRegionNormalizerManager().getRegionNormalizerChore());
Optional.ofNullable(this.regionNormalizerManager)
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just use a null check?

Copy link
Contributor

Choose a reason for hiding this comment

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

Optional.ofNullable() is invoked twice, one here and another within mapper:

    public<U> Optional<U> map(Function<? super T, ? extends U> mapper) {
        Objects.requireNonNull(mapper);
        if (!isPresent())
            return empty();
        else {
            return Optional.ofNullable(mapper.apply(value));
        }
    }

And ofNullable() itself is going to check if value is null, and accordingly going to create new Optional object.

When we have direct Function to deal with, this approach would come with minimal complexity. I am not saying here it is too complex, but compared to one simple null check, yes it is bit complex :)

@Apache9
Copy link
Contributor

Apache9 commented Oct 14, 2020

And in general, I think the design here is a bit strange. If we define RegionNormalizerManager as a separated feature, then we should schedule chore and cancel it in RegionNormalizerManager itself, in the start and stop methods. If not, we should do things like CatalogJanitor, where the class itself is a chore, so in HMaster we will schedule and cancel it. Anyway, let's see if this could fix the problem first.

@Apache9
Copy link
Contributor

Apache9 commented Oct 14, 2020

OK, tried locally, a simple null check could fix the problem.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 11s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+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 _
+1 💚 mvninstall 4m 8s master passed
+1 💚 checkstyle 1m 12s master passed
+1 💚 spotbugs 2m 10s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 48s the patch passed
+1 💚 checkstyle 1m 12s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 18m 56s Patch does not cause any errors with Hadoop 3.1.2 3.2.1 3.3.0.
+1 💚 spotbugs 2m 15s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 12s The patch does not generate ASF License warnings.
42m 49s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #2540
Optional Tests dupname asflicense spotbugs hadoopcheck hbaseanti checkstyle
uname Linux 5a7fbe61f6d2 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 / fd0ecad
Max. process+thread count 84 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) spotbugs=3.1.12
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 27s 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 _
+1 💚 mvninstall 3m 46s master passed
+1 💚 compile 0m 54s master passed
+1 💚 shadedjars 6m 29s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 38s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 33s the patch passed
+1 💚 compile 0m 56s the patch passed
+1 💚 javac 0m 56s the patch passed
+1 💚 shadedjars 6m 31s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 38s the patch passed
_ Other Tests _
+1 💚 unit 140m 39s hbase-server in the patch passed.
166m 44s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #2540
Optional Tests javac javadoc unit shadedjars compile
uname Linux 8b78de58b969 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / fd0ecad
Default Java 1.8.0_232
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/testReport/
Max. process+thread count 4510 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 8s 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 _
+1 💚 mvninstall 4m 49s master passed
+1 💚 compile 1m 11s master passed
+1 💚 shadedjars 7m 22s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 44s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 4m 29s the patch passed
+1 💚 compile 1m 13s the patch passed
+1 💚 javac 1m 13s the patch passed
+1 💚 shadedjars 7m 22s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 42s the patch passed
_ Other Tests _
+1 💚 unit 197m 40s hbase-server in the patch passed.
228m 31s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #2540
Optional Tests javac javadoc unit shadedjars compile
uname Linux 1a328b03a9cc 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 / fd0ecad
Default Java 2020-01-14
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/testReport/
Max. process+thread count 3165 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/10/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@ndimiduk
Copy link
Member Author

@Apache9

And in general, I think the design here is a bit strange.

My objective was to make a normalizer subsystem that's as self-contained as possible. The rough edges are related to the non-modular design of HMaster. I didn't want to refactor the whole class in order to add this feature. As for the design, I'm open to suggestions, if you have anything more specific.

If we define RegionNormalizerManager as a separated feature, then we should schedule chore and cancel it in RegionNormalizerManager itself, in the start and stop methods.

This was my original strategy. It doesn't work well, because master owns directly all these chores, and is picky about the order in which subsystems are initialized. Instantiation of the RegionNormalizerManager is also in an odd place, because of conditional initialization of ZKWatchers.

If not, we should do things like CatalogJanitor, where the class itself is a chore, so in HMaster we will schedule and cancel it.

CatalogJanitor is a good deal simpler and conceptually makes sense being limited in scope to a Chore. It doesn't have a "switch" in ZooKeeper to manage, nor does it have a worker with a background thread.

It appears there's been some time spent recently on the design of CatalogJanitor as a subsystem. Let me study it a bit and see what lessons I have to learn here.

Anyway, let's see if this could fix the problem first.

Sure thing. Since you are both so allergic to the Optional class, I'll swap it for a null check.

@ndimiduk ndimiduk force-pushed the 24628-normalizer-master-chore-shutdown-npe-addendum branch from e4075b7 to 685ebb3 Compare October 14, 2020 16:33
@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 40s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+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 _
+1 💚 mvninstall 4m 21s master passed
+1 💚 checkstyle 1m 15s master passed
+1 💚 spotbugs 2m 23s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 53s the patch passed
+1 💚 checkstyle 1m 12s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 20m 2s Patch does not cause any errors with Hadoop 3.1.2 3.2.1 3.3.0.
+1 💚 spotbugs 2m 51s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 17s The patch does not generate ASF License warnings.
47m 5s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #2540
Optional Tests dupname asflicense spotbugs hadoopcheck hbaseanti checkstyle
uname Linux 265a5b0d69a0 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 / 78b7244
Max. process+thread count 85 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f) spotbugs=3.1.12
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 32s 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 _
+1 💚 mvninstall 4m 4s master passed
+1 💚 compile 1m 4s master passed
+1 💚 shadedjars 7m 10s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 40s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 3m 42s the patch passed
+1 💚 compile 1m 1s the patch passed
+1 💚 javac 1m 1s the patch passed
+1 💚 shadedjars 6m 57s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 35s the patch passed
_ Other Tests _
+1 💚 unit 145m 40s hbase-server in the patch passed.
173m 37s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR #2540
Optional Tests javac javadoc unit shadedjars compile
uname Linux 4f62d522034a 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 78b7244
Default Java 1.8.0_232
Test Results https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/testReport/
Max. process+thread count 4819 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 2m 59s 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 _
+1 💚 mvninstall 4m 59s master passed
+1 💚 compile 1m 14s master passed
+1 💚 shadedjars 7m 34s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 49s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 5m 6s the patch passed
+1 💚 compile 1m 14s the patch passed
+1 💚 javac 1m 14s the patch passed
+1 💚 shadedjars 7m 50s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 43s the patch passed
_ Other Tests _
-1 ❌ unit 206m 30s hbase-server in the patch failed.
240m 54s
Subsystem Report/Notes
Docker Client=19.03.13 Server=19.03.13 base: https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR #2540
Optional Tests javac javadoc unit shadedjars compile
uname Linux 1a8b5aab4509 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 / 78b7244
Default Java 2020-01-14
unit https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/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-2540/11/testReport/
Max. process+thread count 3085 (vs. ulimit of 30000)
modules C: hbase-server U: hbase-server
Console output https://ci-hadoop.apache.org/job/HBase/job/HBase-PreCommit-GitHub-PR/job/PR-2540/11/console
versions git=2.17.1 maven=(cecedd343002696d0abb50b32b541b8a6ba2883f)
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@Apache9
Copy link
Contributor

Apache9 commented Oct 15, 2020

Yes, the initialization order of HMaster is just a mess, too many dependencies...

I like that you want to keep align with the current design of how to schedule chores. It is good to keep the code in one style so later developpers will not be confused. What I said is just suggestion, I'm OK with the current implementation.

Let's see if this could fix the flaky tests.

@Apache9 Apache9 merged commit 70d2f37 into apache:master Oct 15, 2020
Apache9 pushed a commit that referenced this pull request Oct 15, 2020
…e shutdown NPE ADDENDUM) (#2540)

Signed-off-by: Michael Stack <stack@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
@ndimiduk ndimiduk deleted the 24628-normalizer-master-chore-shutdown-npe-addendum branch October 15, 2020 21:12
clarax pushed a commit to clarax/hbase that referenced this pull request Nov 15, 2020
…e shutdown NPE ADDENDUM) (apache#2540)

Signed-off-by: Michael Stack <stack@apache.org>
Signed-off-by: Duo Zhang <zhangduo@apache.org>
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.

5 participants