Skip to content

[HBASE-22874] Canary should not be IA.Public - #580

Closed
shahrs87 wants to merge 13 commits into
apache:masterfrom
shahrs87:HBASE-22874
Closed

[HBASE-22874] Canary should not be IA.Public#580
shahrs87 wants to merge 13 commits into
apache:masterfrom
shahrs87:HBASE-22874

Conversation

@shahrs87

Copy link
Copy Markdown
Contributor

Things I changed in this PR:

  1. Created CanaryInterface class which will be marked as Public. (I am not that good with names. Please let me know if you can think of something better).
  2. Created 3 methods to call RegionCanary, RegionServerCanary and ZookeeperCanary via Api.
  3. Created conf properties for all options that we pass via ToolRunner.
  4. Tried to commonalize the code between ToolRunner and API usage.

Outstanding questions that I need help from community.

  1. Does it make sense to have "daemon" flag via api usage ?
  2. Should we allow using "interval" argument via api. If I specify interval it means canary will run every "interval" seconds.
  3. There are 3 properties which fails on error. -f, -treatFailureAsError, -failureArError
    Can we just create 1 conf property for usage via API. We still will support all 3 arguments via ToolRunner interface.
  4. How to figure out which constructor for CanaryInterface to expose ?
  5. Do we need to instantiate executor if it is null ? Today Canary has one constructor which accepts executor as argument. We never verify whether the passed executor is instantiated or not. Feels like bug to me. Or is it understood that if someone calls that constructor, its his/her responsibility to instantiate executor.

For some unknown reason asfgit user closed my earlier PR: #565 so I created another one.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
0reexec82Docker mode activated.
_ Prechecks _
+1dupname0No case conflicting files found.
+1hbaseanti0Patch does not have any anti-patterns.
+1@author0The patch does not contain any @author tags.
+1test4tests0The patch appears to include 1 new or modified test files.
_ master Compile Tests _
+1mvninstall401master passed
+1compile68master passed
+1checkstyle94master passed
+1shadedjars304branch has no errors when building our shaded downstream artifacts.
+1javadoc40master passed
0spotbugs276Used deprecated FindBugs config; considering switching to SpotBugs.
+1findbugs273master passed
_ Patch Compile Tests _
+1mvninstall331the patch passed
+1compile60the patch passed
+1javac60the patch passed
-1checkstyle89hbase-server: The patch generated 2 new + 21 unchanged - 2 fixed = 23 total (was 23)
+1whitespace0The patch has no whitespace issues.
+1shadedjars323patch has no errors when building our shaded downstream artifacts.
+1hadoopcheck1108Patch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
+1javadoc37the patch passed
+1findbugs282the patch passed
_ Other Tests _
-1unit16255hbase-server in the patch failed.
+1asflicense27The patch does not generate ASF License warnings.
20185
ReasonTests
Failed junit testshadoop.hbase.client.TestFromClientSide
SubsystemReport/Notes
DockerClient=19.03.2 Server=19.03.2 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/1/artifact/out/Dockerfile
GITHUB PR#580
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 12056470573a 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-580/out/precommit/personality/provided.sh
git revisionmaster / dfe5280
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/1/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/1/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/1/testReport/
Max. process+thread count4621 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/1/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.10.0 http://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 36sDocker mode activated.
_ Prechecks _
💚dupname0m 1sNo case conflicting files found.
💚hbaseanti0m 0sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💚mvninstall5m 24smaster passed
💚compile0m 55smaster passed
💚checkstyle1m 18smaster passed
💚shadedjars4m 31sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 37smaster passed
💙spotbugs4m 0sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs3m 58smaster passed
_ Patch Compile Tests _
💚mvninstall4m 49sthe patch passed
💚compile0m 54sthe patch passed
💚javac0m 54sthe patch passed
💔checkstyle1m 19shbase-server: The patch generated 1 new + 21 unchanged - 2 fixed = 22 total (was 23)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 34spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 34sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 35sthe patch passed
💚findbugs4m 16sthe patch passed
_ Other Tests _
💔unit158m 29shbase-server in the patch failed.
💚asflicense0m 28sThe patch does not generate ASF License warnings.
215m 1s
SubsystemReport/Notes
DockerClient=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/2/artifact/out/Dockerfile
GITHUB PR#580
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux 8bfe6c5d2891 4.15.0-60-generic #67-Ubuntu SMP Thu Aug 22 16:55:30 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-580/out/precommit/personality/provided.sh
git revisionmaster / 0d338a1
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/2/artifact/out/diff-checkstyle-hbase-server.txt
unithttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/2/artifact/out/patch-unit-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/2/testReport/
Max. process+thread count4916 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/2/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@shahrs87

Copy link
Copy Markdown
ContributorAuthor

@jatsakthi Would like to see this commit in 1.3 release also. Apologies if I am requesting to review too many PR's. I will really appreciate if you can review this PR. Thank you !

@InterfaceAudience.Private
public final class Canary implements Tool {
@InterfaceAudience.LimitedPrivate(HBaseInterfaceAudience.TOOLS)
public class Canary implements Tool, CanaryInterface {

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.

Can Canary be an Interface?

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.

Yeah please make the interface Canary and the tool CanaryTool or CanaryImpl or something.

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.

@saintstack@busbey Addressed your comments in latest commit. Could you please review. Thank you !

@saintstack

Copy link
Copy Markdown
Contributor

Outstanding questions that I need help from community.

Does it make sense to have "daemon" flag via api usage ?
Should we allow using "interval" argument via api. If I specify interval it means canary will run every "interval" seconds.
There are 3 properties which fails on error. -f, -treatFailureAsError, -failureArError
Can we just create 1 conf property for usage via API. We still will support all 3 arguments via ToolRunner interface.
How to figure out which constructor for CanaryInterface to expose ?
Do we need to instantiate executor if it is null ? Today Canary has one constructor which accepts executor as argument. We never verify whether the passed executor is instantiated or not. Feels like bug to me. Or is it understood that if someone calls that constructor, its his/her responsibility to instantiate executor.

On 'daemon' api option, it is an odd option to expose IMO. Would think it daemon would be set always when calling something via API (i.e. in context).

Interval as argument seems fine. What you thinking?

One error option makes sense.

" Feels like bug to me. " Me too.

From an API, I'd think you'd be passing an executor?

@shahrs87

Copy link
Copy Markdown
ContributorAuthor

Thank you @saintstack for your review.

Interval as argument seems fine. What you thinking?

If I understand the interval parameter correctly, it will run the given canary periodically every interval seconds. If we are running the Canary via ToolRunner, it will create a new process and we can make it run every few seconds but if we call via api from some application, then it is the application's responsibility to call canary every interval seconds.
Any thoughts ?

@saintstack

Copy link
Copy Markdown
Contributor

Makes sense. Interval is for the daemon version of Canary which makes no sense when being called from API. Yeah, no 'interval'. No 'daemon' option either.

@Apache-HBase

Copy link
Copy Markdown

💔 -1 overall

VoteSubsystemRuntimeComment
💙reexec0m 42sDocker mode activated.
_ Prechecks _
💚dupname0m 0sNo case conflicting files found.
💚hbaseanti0m 1sPatch does not have any anti-patterns.
💚@author0m 0sThe patch does not contain any @author tags.
💚test4tests0m 0sThe patch appears to include 1 new or modified test files.
_ master Compile Tests _
💚mvninstall6m 54smaster passed
💚compile0m 57smaster passed
💚checkstyle1m 26smaster passed
💚shadedjars4m 32sbranch has no errors when building our shaded downstream artifacts.
💚javadoc0m 38smaster passed
💙spotbugs4m 16sUsed deprecated FindBugs config; considering switching to SpotBugs.
💚findbugs4m 14smaster passed
💛patch4m 23sUsed diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
💚mvninstall5m 12sthe patch passed
💚compile1m 0sthe patch passed
💚javac1m 0sthe patch passed
💔checkstyle1m 25shbase-server: The patch generated 3 new + 21 unchanged - 2 fixed = 24 total (was 23)
💚whitespace0m 0sThe patch has no whitespace issues.
💚shadedjars4m 46spatch has no errors when building our shaded downstream artifacts.
💚hadoopcheck15m 38sPatch does not cause any errors with Hadoop 2.8.5 2.9.2 or 3.1.2.
💚javadoc0m 35sthe patch passed
💚findbugs4m 26sthe patch passed
_ Other Tests _
💚unit160m 44shbase-server in the patch passed.
💚asflicense0m 38sThe patch does not generate ASF License warnings.
220m 12s
SubsystemReport/Notes
DockerClient=19.03.1 Server=19.03.1 base: https://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/4/artifact/out/Dockerfile
GITHUB PR#580
Optional Testsdupname asflicense javac javadoc unit spotbugs findbugs shadedjars hadoopcheck hbaseanti checkstyle compile
unameLinux b9370cd1227d 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 GNU/Linux
Build toolmaven
Personality/home/jenkins/jenkins-slave/workspace/HBase-PreCommit-GitHub-PR_PR-580/out/precommit/personality/provided.sh
git revisionmaster / cb62f73
Default Java1.8.0_181
checkstylehttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/4/artifact/out/diff-checkstyle-hbase-server.txt
Test Resultshttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/4/testReport/
Max. process+thread count4357 (vs. ulimit of 10000)
modulesC: hbase-server U: hbase-server
Console outputhttps://builds.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-580/4/console
versionsgit=2.11.0 maven=2018-06-17T18:33:14Z) findbugs=3.1.11
Powered byApache Yetus 0.11.0 https://yetus.apache.org

This message was automatically generated.

@shahrs87

Copy link
Copy Markdown
ContributorAuthor

@saintstack@busbey could you guys please make another pass ? Thank you !

@busbey

Copy link
Copy Markdown
Contributor

overall this looks good to me. I've made a correction locally to make sure bin/hbase references the new CanaryTool class. I'm running a last set of tests locally then I'll merge.

@asfgitasfgit closed this in 5aa8d3aOct 3, 2019
asfgit pushed a commit that referenced this pull request Oct 3, 2019
…tool implementation
Closes#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Signed-off-by: Sean Busbey <busbey@apache.org>
asfgit pushed a commit that referenced this pull request Oct 3, 2019
…tool implementation
Closes#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Signed-off-by: Sean Busbey <busbey@apache.org>
(cherry picked from commit b5a3967)
asfgit pushed a commit that referenced this pull request Oct 3, 2019
…tool implementation
Closes#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Signed-off-by: Sean Busbey <busbey@apache.org>
(cherry picked from commit b5a3967)
@shahrs87

Copy link
Copy Markdown
ContributorAuthor

Thank you @busbey for the review and merge. Let me know if you want me to create PR for branch-1 or branch-2.

@the-sakthi

Copy link
Copy Markdown
Member

@shahrs87 I am waiting for this commit to go into branch-1.3 for the 1.3 release. Could you please take care of the backports to branch-1 & branch-2 as well?

@shahrs87

Copy link
Copy Markdown
ContributorAuthor

Could you please take care of the backports to branch-1 & branch-2 as well?

I am relatively new to this project. I don't know the protocol of who handles the backport to branch-1 and branch-2. I was of the view that committer will take care of backports and if it needs more work than simple cherry-pick then he/she will let me know. In any case, I am fine to create a new PR for branch-1 and branch-2. Please let me know.

@shahrs87

Copy link
Copy Markdown
ContributorAuthor

Also I see that @busbey merged this commit to branch-2.1 and branch-2.2. So I think he is taking care of backports. :)

asfgit pushed a commit that referenced this pull request Oct 4, 2019
…tool implementation
Closes#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Branch-1 specific changes for differences in APIs and cleanup of the ref guide using a classname.
Co-authored-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
asfgit pushed a commit that referenced this pull request Oct 4, 2019
…tool implementation
Closes#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Branch-1.3 specific changes for differences in APIs and cleanup of the ref guide using a classname.
Co-authored-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
asfgit pushed a commit that referenced this pull request Oct 10, 2019
…tool implementation
Closes#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Branch-1 specific changes for differences in APIs and cleanup of the ref guide using a classname.
Co-authored-by: Sean Busbey <busbey@apache.org>
Signed-off-by: Sean Busbey <busbey@apache.org>
symat pushed a commit to symat/hbase that referenced this pull request Feb 17, 2021
…tool implementation
Closesapache#580
* Canary is now an IA.Public interface
* CanaryTool is now the implementation
Signed-off-by: Sean Busbey <busbey@apache.org>
(cherry picked from commit b5a3967)
(cherry picked from commit f37105c)
Change-Id: I5023d011922e17398d76dd8585008e0eccb9e989
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

@shahrs87@Apache-HBase@saintstack@busbey@the-sakthi