hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [hbase] Apache9 commented on a change in pull request #2779: HBASE-23340 hmaster /hbase/replication/rs session expired (hbase repl…
Date Thu, 07 Jan 2021 07:38:37 GMT

Apache9 commented on a change in pull request #2779:
URL: https://github.com/apache/hbase/pull/2779#discussion_r553155282



##########
File path: hbase-server/src/main/java/org/apache/hadoop/hbase/replication/master/ReplicationLogCleaner.java
##########
@@ -92,12 +96,20 @@ public boolean apply(FileStatus file) {
   }
 
   @Override
-  public void setConf(Configuration config) {
-    // Make my own Configuration.  Then I'll have my own connection to zk that
-    // I can close myself when comes time.
-    Configuration conf = new Configuration(config);
+  public void init(Map<String, Object> params) {
+    super.init(params);
     try {
-      setConf(conf, new ZKWatcher(conf, "replicationLogCleaner", null));
+      if (MapUtils.isNotEmpty(params)) {
+        Object master = params.get(HMaster.MASTER);
+        if (master != null && master instanceof HMaster) {
+          zkw = ((HMaster) master).getZooKeeper();
+          shareZK = true;

Review comment:
       Better set this flag to true by default, and in the below `if (zkw == null)`, set it
to false. Without any other assumptions, it is possible that HMaster.getZooKeeper returns
null and we will create a new ZKWatcher but shareZK is false then we will not close it...




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



Mime
View raw message