sandeepvinayak commented on a change in pull request #2970:
URL: https://github.com/apache/hbase/pull/2970#discussion_r579749696
##########
File path:
hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSourceManager.java
##########
@@ -189,13 +189,21 @@ public ReplicationSourceManager(final ReplicationQueues
replicationQueues,
* @param holdLogInZK if true then the log is retained in ZK
*/
public synchronized void logPositionAndCleanOldLogs(Path log, String id,
long position,
- boolean queueRecovered, boolean holdLogInZK) throws
ReplicationSourceWithoutPeerException {
+ boolean queueRecovered, boolean holdLogInZK) {
String fileName = log.getName();
this.replicationQueues.setLogPosition(id, fileName, position);
if (holdLogInZK) {
return;
}
- cleanOldLogs(fileName, id, queueRecovered);
+
+ try {
+ cleanOldLogs(fileName, id, queueRecovered);
+ } catch (ReplicationSourceWithoutPeerException rspe) {
+ // This means the source is running and replication peer have been
removed
+ // We can call the removePeer workflow to terminate the source gracefully
+ LOG.warn("Replication peer" + id + "has been removed and source is still
running", rspe);
+ removePeer(id);
Review comment:
this is the main fix.
----------------------------------------------------------------
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]