bharathv commented on a change in pull request #3204:
URL: https://github.com/apache/hbase/pull/3204#discussion_r625390467
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
##########
@@ -653,6 +658,30 @@ public void regionServerRemoved(String regionserver) {
transferQueues(regionserver);
}
+ /**
+ * We want to run the peer removal in a separate thread when the peer removal
+ * is called from ReplicationSource shipper thread on encountering
NoNodeException
+ * because peerRemoved terminate the source which might leave replication
source
+ * in orphaned state.
+ * See HBASE-25741.
+ * @param peerId peer ID to be removed.
+ */
+ public void schedulePeerRemoval(final String peerId) {
+ final ExecutorService threadPool =
+
Executors.newSingleThreadExecutor(Threads.getNamedThreadFactory("peer-removal"));
+ try {
+ Future<?> res = threadPool.submit(new Runnable() {
+ @Override public void run() {
+ peerRemoved(peerId);
+ }
+ });
+ res.get();
Review comment:
> replication shipper thread calls this method and wait till it complete
the execution.
The thread is killed during wait and this thread pool is never cleaned up.
My point is we don't need to wait on it. Instead submit this task to the
"executor" in this class, that executor is shutdown eventually.
--
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:
[email protected]