[hbase] branch branch-2.4 updated: HBASE-25534 Honor TableDescriptor settings earlier in normalization (#2917)

2021-02-09 Thread ndimiduk
This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
 new 5693705  HBASE-25534 Honor TableDescriptor settings earlier in 
normalization (#2917)
5693705 is described below

commit 56937056ea70f7a6a922912df2666d5f3f7e709c
Author: Baiqiang Zhao 
AuthorDate: Wed Feb 10 08:45:26 2021 +0800

HBASE-25534 Honor TableDescriptor settings earlier in normalization (#2917)

Signed-off-by: Nick Dimiduk 
---
 .../hbase/master/normalizer/RegionNormalizer.java  |   8 +-
 .../master/normalizer/RegionNormalizerWorker.java  |   5 +-
 .../master/normalizer/SimpleRegionNormalizer.java  | 116 +++-
 .../normalizer/TestRegionNormalizerWorker.java |   6 +-
 .../normalizer/TestSimpleRegionNormalizer.java | 195 +
 5 files changed, 247 insertions(+), 83 deletions(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizer.java
index 6f939da..eae34c6 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizer.java
@@ -20,7 +20,7 @@ package org.apache.hadoop.hbase.master.normalizer;
 
 import java.util.List;
 import org.apache.hadoop.conf.Configurable;
-import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.TableDescriptor;
 import org.apache.hadoop.hbase.master.MasterServices;
 import org.apache.yetus.audience.InterfaceAudience;
 
@@ -38,7 +38,7 @@ import org.apache.yetus.audience.InterfaceAudience;
 interface RegionNormalizer extends Configurable {
   /**
* Set the master service. Must be called before first call to
-   * {@link #computePlansForTable(TableName)}.
+   * {@link #computePlansForTable(TableDescriptor)}.
* @param masterServices master services to use
*/
   void setMasterServices(MasterServices masterServices);
@@ -46,9 +46,9 @@ interface RegionNormalizer extends Configurable {
   /**
* Computes a list of normalizer actions to perform on the target table. 
This is the primary
* entry-point from the Master driving a normalization activity.
-   * @param table table to normalize
+   * @param tableDescriptor table descriptor for table which needs normalize
* @return A list of the normalization actions to perform, or an empty list
*   if there's nothing to do.
*/
-  List computePlansForTable(TableName table);
+  List computePlansForTable(TableDescriptor 
tableDescriptor);
 }
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizerWorker.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizerWorker.java
index 408317a..59d2f46 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizerWorker.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/RegionNormalizerWorker.java
@@ -178,8 +178,9 @@ class RegionNormalizerWorker implements 
PropagatingConfigurationObserver, Runnab
   return Collections.emptyList();
 }
 
+final TableDescriptor tblDesc;
 try {
-  final TableDescriptor tblDesc = 
masterServices.getTableDescriptors().get(tableName);
+  tblDesc = masterServices.getTableDescriptors().get(tableName);
   if (tblDesc != null && !tblDesc.isNormalizationEnabled()) {
 LOG.debug("Skipping table {} because normalization is disabled in its 
table properties.",
   tableName);
@@ -190,7 +191,7 @@ class RegionNormalizerWorker implements 
PropagatingConfigurationObserver, Runnab
   return Collections.emptyList();
 }
 
-final List plans = 
regionNormalizer.computePlansForTable(tableName);
+final List plans = 
regionNormalizer.computePlansForTable(tblDesc);
 if (CollectionUtils.isEmpty(plans)) {
   LOG.debug("No normalization required for table {}.", tableName);
   return Collections.emptyList();
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
index 5245568..39568bb 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/normalizer/SimpleRegionNormalizer.java
@@ -18,7 +18,6 @@
 package org.apache.hadoop.hbase.master.normalizer;
 
 import static 
org.apache.hbase.thirdparty.org.apache.commons.collections4.CollectionUtils.isEmpty;
-import java.io.IOException;
 import java.time.Instant;
 import java.time.Period;
 import java.util.ArrayList;
@@ -27,6 +26,7 @@ import java.util.Li

[hbase] branch master updated (4a3ff98 -> 25e3633)

2021-02-09 Thread ndimiduk
This is an automated email from the ASF dual-hosted git repository.

ndimiduk pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git.


from 4a3ff98  HBASE-25559 Terminate threads of oldsources while RS is 
closing (#2938)
 add 25e3633  HBASE-25534 Honor TableDescriptor settings earlier in 
normalization (#2917)

No new revisions were added by this update.

Summary of changes:
 .../hbase/master/normalizer/RegionNormalizer.java  |   8 +-
 .../master/normalizer/RegionNormalizerWorker.java  |   5 +-
 .../master/normalizer/SimpleRegionNormalizer.java  | 116 +++-
 .../normalizer/TestRegionNormalizerWorker.java |   6 +-
 .../normalizer/TestSimpleRegionNormalizer.java | 195 +
 5 files changed, 247 insertions(+), 83 deletions(-)



[hbase-site] branch asf-site updated: INFRA-10751 Empty commit

2021-02-09 Thread git-site-role
This is an automated email from the ASF dual-hosted git repository.

git-site-role pushed a commit to branch asf-site
in repository https://gitbox.apache.org/repos/asf/hbase-site.git


The following commit(s) were added to refs/heads/asf-site by this push:
 new 63e639c  INFRA-10751 Empty commit
63e639c is described below

commit 63e639c31b7e1d1f09bf224f8a9f6b90633f409c
Author: jenkins 
AuthorDate: Tue Feb 9 20:22:26 2021 +

INFRA-10751 Empty commit



[hbase] branch branch-2 updated: HBASE-25519 BLOCKSIZE needs to support pretty print (#2944)

2021-02-09 Thread stack
This is an automated email from the ASF dual-hosted git repository.

stack pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
 new 9a6bd5b  HBASE-25519 BLOCKSIZE needs to support pretty print (#2944)
9a6bd5b is described below

commit 9a6bd5b6f1917ea5d484e3cdc35bc1f25abc200e
Author: Baiqiang Zhao 
AuthorDate: Tue Feb 9 23:27:27 2021 +0800

HBASE-25519 BLOCKSIZE needs to support pretty print (#2944)
---
 .../org/apache/hadoop/hbase/HColumnDescriptor.java |  5 
 .../client/ColumnFamilyDescriptorBuilder.java  | 12 ++
 .../client/TestColumnFamilyDescriptorBuilder.java  | 28 ++
 .../hbase/client/TestTableDescriptorBuilder.java   |  8 ---
 hbase-shell/src/main/ruby/hbase/admin.rb   |  2 +-
 5 files changed, 51 insertions(+), 4 deletions(-)

diff --git 
a/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java 
b/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
index a203936..ac290dc 100644
--- a/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
+++ b/hbase-client/src/main/java/org/apache/hadoop/hbase/HColumnDescriptor.java
@@ -313,6 +313,11 @@ public class HColumnDescriptor implements 
ColumnFamilyDescriptor, Comparable {DURABILITY => 'ASYNC_WAL'}}, {NAME => 'cf', 
BLOCKSIZE => '1000'}",
+"{TABLE_ATTRIBUTES => {DURABILITY => 'ASYNC_WAL'}}, "
++ "{NAME => 'cf', BLOCKSIZE => '131072 B (128KB)'}",
   htd.toStringCustomizedValues());
 
 htd = TableDescriptorBuilder.newBuilder(htd)
@@ -391,7 +392,8 @@ public class TestTableDescriptorBuilder {
   "'testStringCustomizedValues', " +
 "{TABLE_ATTRIBUTES => {DURABILITY => 'ASYNC_WAL', "
 + "MAX_FILESIZE => '10737942528 B (10GB 512KB)', "
-+ "MEMSTORE_FLUSHSIZE => '268435456 B (256MB)'}}, {NAME => 'cf', 
BLOCKSIZE => '1000'}",
++ "MEMSTORE_FLUSHSIZE => '268435456 B (256MB)'}}, "
++ "{NAME => 'cf', BLOCKSIZE => '131072 B (128KB)'}",
   htd.toStringCustomizedValues());
   }
 
diff --git a/hbase-shell/src/main/ruby/hbase/admin.rb 
b/hbase-shell/src/main/ruby/hbase/admin.rb
index 776c9e3..62b2ab1 100644
--- a/hbase-shell/src/main/ruby/hbase/admin.rb
+++ b/hbase-shell/src/main/ruby/hbase/admin.rb
@@ -1025,7 +1025,7 @@ module Hbase
   end
   family.setTimeToLive(arg.delete(ColumnFamilyDescriptorBuilder::TTL)) if 
arg.include?(ColumnFamilyDescriptorBuilder::TTL)
   
family.setDataBlockEncoding(org.apache.hadoop.hbase.io.encoding.DataBlockEncoding.valueOf(arg.delete(ColumnFamilyDescriptorBuilder::DATA_BLOCK_ENCODING)))
 if arg.include?(ColumnFamilyDescriptorBuilder::DATA_BLOCK_ENCODING)
-  
family.setBlocksize(JInteger.valueOf(arg.delete(ColumnFamilyDescriptorBuilder::BLOCKSIZE)))
 if arg.include?(ColumnFamilyDescriptorBuilder::BLOCKSIZE)
+  
family.setBlocksize(arg.delete(ColumnFamilyDescriptorBuilder::BLOCKSIZE)) if 
arg.include?(ColumnFamilyDescriptorBuilder::BLOCKSIZE)
   
family.setMaxVersions(JInteger.valueOf(arg.delete(HConstants::VERSIONS))) if 
arg.include?(HConstants::VERSIONS)
   
family.setMinVersions(JInteger.valueOf(arg.delete(ColumnFamilyDescriptorBuilder::MIN_VERSIONS)))
 if arg.include?(ColumnFamilyDescriptorBuilder::MIN_VERSIONS)
   
family.setKeepDeletedCells(org.apache.hadoop.hbase.KeepDeletedCells.valueOf(arg.delete(ColumnFamilyDescriptorBuilder::KEEP_DELETED_CELLS).to_s.upcase))
 if arg.include?(ColumnFamilyDescriptorBuilder::KEEP_DELETED_CELLS)



[hbase] branch branch-2.2 updated: HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

2021-02-09 Thread sunxin
This is an automated email from the ASF dual-hosted git repository.

sunxin pushed a commit to branch branch-2.2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.2 by this push:
 new 35ece0a  HBASE-25559 Terminate threads of oldsources while RS is 
closing (#2938)
35ece0a is described below

commit 35ece0a5da8e41d2f54a577325addd93843f78f2
Author: XinSun 
AuthorDate: Tue Feb 9 16:32:46 2021 +0800

HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

Signed-off-by: Viraj Jasani 
Signed-off-by: stack 
Signed-off-by: Wellington Chevreuil 
---
 .../regionserver/ReplicationSource.java|   2 +-
 .../regionserver/ReplicationSourceManager.java |   3 +
 .../TestReplicationSourceManagerJoin.java  | 109 +
 3 files changed, 113 insertions(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 180acb3..039f5db 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -112,7 +112,7 @@ public class ReplicationSource implements 
ReplicationSourceInterface {
   // Maximum number of retries before taking bold actions
   private int maxRetriesMultiplier;
   // Indicates if this particular source is running
-  private volatile boolean sourceRunning = false;
+  volatile boolean sourceRunning = false;
   // Metrics for this source
   private MetricsSource metrics;
   // WARN threshold for the number of queued logs, defaults to 2
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index 082981e..76edc26 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -799,6 +799,9 @@ public class ReplicationSourceManager implements 
ReplicationListener {
 for (ReplicationSourceInterface source : this.sources.values()) {
   source.terminate("Region server is closing");
 }
+for (ReplicationSourceInterface source : this.oldsources) {
+  source.terminate("Region server is closing");
+}
   }
 
   /**
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
new file mode 100644
index 000..1795588
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication.regionserver;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.HRegionServer;
+import org.apache.hadoop.hbase.replication.TestReplicationBase;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+

[hbase] branch branch-2.3 updated: HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

2021-02-09 Thread sunxin
This is an automated email from the ASF dual-hosted git repository.

sunxin pushed a commit to branch branch-2.3
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.3 by this push:
 new 1938067  HBASE-25559 Terminate threads of oldsources while RS is 
closing (#2938)
1938067 is described below

commit 19380670e8df250f44475b9d669b350e06bd4791
Author: XinSun 
AuthorDate: Tue Feb 9 16:32:46 2021 +0800

HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

Signed-off-by: Viraj Jasani 
Signed-off-by: stack 
Signed-off-by: Wellington Chevreuil 
---
 .../regionserver/ReplicationSource.java|   2 +-
 .../regionserver/ReplicationSourceManager.java |   3 +
 .../TestReplicationSourceManagerJoin.java  | 109 +
 3 files changed, 113 insertions(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 3e9db5f..c52e546 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -113,7 +113,7 @@ public class ReplicationSource implements 
ReplicationSourceInterface {
   // Maximum number of retries before taking bold actions
   private int maxRetriesMultiplier;
   // Indicates if this particular source is running
-  private volatile boolean sourceRunning = false;
+  volatile boolean sourceRunning = false;
   // Metrics for this source
   private MetricsSource metrics;
   // WARN threshold for the number of queued logs, defaults to 2
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index c66796d..1ac793b 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -812,6 +812,9 @@ public class ReplicationSourceManager implements 
ReplicationListener {
 for (ReplicationSourceInterface source : this.sources.values()) {
   source.terminate("Region server is closing");
 }
+for (ReplicationSourceInterface source : this.oldsources) {
+  source.terminate("Region server is closing");
+}
   }
 
   /**
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
new file mode 100644
index 000..1795588
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication.regionserver;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.HRegionServer;
+import org.apache.hadoop.hbase.replication.TestReplicationBase;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+

[hbase] branch branch-2.4 updated: HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

2021-02-09 Thread sunxin
This is an automated email from the ASF dual-hosted git repository.

sunxin pushed a commit to branch branch-2.4
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2.4 by this push:
 new e7414f9  HBASE-25559 Terminate threads of oldsources while RS is 
closing (#2938)
e7414f9 is described below

commit e7414f98fd631f5c2503555c8e804ea37ff5b6f9
Author: XinSun 
AuthorDate: Tue Feb 9 16:32:46 2021 +0800

HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

Signed-off-by: Viraj Jasani 
Signed-off-by: stack 
Signed-off-by: Wellington Chevreuil 
---
 .../regionserver/ReplicationSource.java|   2 +-
 .../regionserver/ReplicationSourceManager.java |   3 +
 .../TestReplicationSourceManagerJoin.java  | 109 +
 3 files changed, 113 insertions(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index fadccb7..6a64dd8 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -115,7 +115,7 @@ public class ReplicationSource implements 
ReplicationSourceInterface {
   // Maximum number of retries before taking bold actions
   private int maxRetriesMultiplier;
   // Indicates if this particular source is running
-  private volatile boolean sourceRunning = false;
+  volatile boolean sourceRunning = false;
   // Metrics for this source
   private MetricsSource metrics;
   // WARN threshold for the number of queued logs, defaults to 2
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index 5bd7157..a318f0c 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -833,6 +833,9 @@ public class ReplicationSourceManager implements 
ReplicationListener {
 for (ReplicationSourceInterface source : this.sources.values()) {
   source.terminate("Region server is closing");
 }
+for (ReplicationSourceInterface source : this.oldsources) {
+  source.terminate("Region server is closing");
+}
   }
 
   /**
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
new file mode 100644
index 000..1795588
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication.regionserver;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.HRegionServer;
+import org.apache.hadoop.hbase.replication.TestReplicationBase;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+

[hbase] branch branch-2 updated: HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

2021-02-09 Thread sunxin
This is an automated email from the ASF dual-hosted git repository.

sunxin pushed a commit to branch branch-2
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/branch-2 by this push:
 new b05dcac  HBASE-25559 Terminate threads of oldsources while RS is 
closing (#2938)
b05dcac is described below

commit b05dcac9fdfccf77a00d76e71acc5d64a9b8edaf
Author: XinSun 
AuthorDate: Tue Feb 9 16:32:46 2021 +0800

HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

Signed-off-by: Viraj Jasani 
Signed-off-by: stack 
Signed-off-by: Wellington Chevreuil 
---
 .../regionserver/ReplicationSource.java|   2 +-
 .../regionserver/ReplicationSourceManager.java |   3 +
 .../TestReplicationSourceManagerJoin.java  | 109 +
 3 files changed, 113 insertions(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index fadccb7..6a64dd8 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -115,7 +115,7 @@ public class ReplicationSource implements 
ReplicationSourceInterface {
   // Maximum number of retries before taking bold actions
   private int maxRetriesMultiplier;
   // Indicates if this particular source is running
-  private volatile boolean sourceRunning = false;
+  volatile boolean sourceRunning = false;
   // Metrics for this source
   private MetricsSource metrics;
   // WARN threshold for the number of queued logs, defaults to 2
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index ee57808..bfd4570 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -832,6 +832,9 @@ public class ReplicationSourceManager implements 
ReplicationListener {
 for (ReplicationSourceInterface source : this.sources.values()) {
   source.terminate("Region server is closing");
 }
+for (ReplicationSourceInterface source : this.oldsources) {
+  source.terminate("Region server is closing");
+}
   }
 
   /**
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
new file mode 100644
index 000..1795588
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication.regionserver;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.HRegionServer;
+import org.apache.hadoop.hbase.replication.TestReplicationBase;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+impo

[hbase] branch master updated: HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

2021-02-09 Thread sunxin
This is an automated email from the ASF dual-hosted git repository.

sunxin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/hbase.git


The following commit(s) were added to refs/heads/master by this push:
 new 4a3ff98  HBASE-25559 Terminate threads of oldsources while RS is 
closing (#2938)
4a3ff98 is described below

commit 4a3ff989430da21f7b40affc096b3094beb7deb6
Author: XinSun 
AuthorDate: Tue Feb 9 16:32:46 2021 +0800

HBASE-25559 Terminate threads of oldsources while RS is closing (#2938)

Signed-off-by: Viraj Jasani 
Signed-off-by: stack 
Signed-off-by: Wellington Chevreuil 
---
 .../regionserver/ReplicationSource.java|   2 +-
 .../regionserver/ReplicationSourceManager.java |   3 +
 .../TestReplicationSourceManagerJoin.java  | 109 +
 3 files changed, 113 insertions(+), 1 deletion(-)

diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
index 317db66..6fb725d 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java
@@ -112,7 +112,7 @@ public class ReplicationSource implements 
ReplicationSourceInterface {
   // Maximum number of retries before taking bold actions
   private int maxRetriesMultiplier;
   // Indicates if this particular source is running
-  private volatile boolean sourceRunning = false;
+  volatile boolean sourceRunning = false;
   // Metrics for this source
   private MetricsSource metrics;
   // WARN threshold for the number of queued logs, defaults to 2
diff --git 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
index a8a35b1..a276b78 100644
--- 
a/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
+++ 
b/hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
@@ -1020,6 +1020,9 @@ public class ReplicationSourceManager implements 
ReplicationListener {
 for (ReplicationSourceInterface source : this.sources.values()) {
   source.terminate("Region server is closing");
 }
+for (ReplicationSourceInterface source : this.oldsources) {
+  source.terminate("Region server is closing");
+}
   }
 
   /**
diff --git 
a/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
new file mode 100644
index 000..1795588
--- /dev/null
+++ 
b/hbase-server/src/test/java/org/apache/hadoop/hbase/replication/regionserver/TestReplicationSourceManagerJoin.java
@@ -0,0 +1,109 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hadoop.hbase.replication.regionserver;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.util.Optional;
+import java.util.stream.Stream;
+
+import org.apache.hadoop.hbase.HBaseClassTestRule;
+import org.apache.hadoop.hbase.HConstants;
+import org.apache.hadoop.hbase.TableName;
+import org.apache.hadoop.hbase.client.ColumnFamilyDescriptorBuilder;
+import org.apache.hadoop.hbase.client.Put;
+import org.apache.hadoop.hbase.client.Table;
+import org.apache.hadoop.hbase.client.TableDescriptor;
+import org.apache.hadoop.hbase.client.TableDescriptorBuilder;
+import org.apache.hadoop.hbase.regionserver.HRegionServer;
+import org.apache.hadoop.hbase.replication.TestReplicationBase;
+import org.apache.hadoop.hbase.testclassification.MediumTests;
+import org.apache.hadoop.hbase.testclassification.ReplicationTests;
+import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.JVMClusterUtil;
+import org.junit.BeforeClass;
+import org.junit.ClassRule;
+import