Skip to content

Commit c94ec54

Browse files
committed
HBASE-27368 Do not need to throw IllegalStateException when peer is not active in ReplicationSource.initialize (#4779)
Signed-off-by: Xin Sun <ddupgs@gmail.com> (cherry picked from commit 460bb47)
1 parent 356f91a commit c94ec54

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

hbase-server/src/main/java/org/apache/hadoop/hbase/replication/regionserver/ReplicationSource.java

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ WALEntryFilter getWalEntryFilter() {
425425
return walEntryFilter;
426426
}
427427

428-
protected final void uncaughtException(Thread t, Throwable e, ReplicationSourceManager manager,
428+
private void uncaughtException(Thread t, Throwable e, ReplicationSourceManager manager,
429429
String peerId) {
430430
RSRpcServices.exitIfOOME(e);
431431
LOG.error("Unexpected exception in {} currentPath={}", t.getName(), getCurrentPath(), e);
@@ -552,15 +552,10 @@ private void initialize() {
552552
}
553553

554554
if (!this.isSourceActive()) {
555+
// this means the server is shutting down or the source is terminated, just give up
556+
// initializing
555557
setSourceStartupStatus(false);
556-
if (Thread.currentThread().isInterrupted()) {
557-
// If source is not running and thread is interrupted this means someone has tried to
558-
// remove this peer.
559-
return;
560-
}
561-
562-
retryStartup.set(!this.abortOnError);
563-
throw new IllegalStateException("Source should be active.");
558+
return;
564559
}
565560

566561
sleepMultiplier = 1;
@@ -582,15 +577,12 @@ private void initialize() {
582577
}
583578

584579
if (!this.isSourceActive()) {
580+
// this means the server is shutting down or the source is terminated, just give up
581+
// initializing
585582
setSourceStartupStatus(false);
586-
if (Thread.currentThread().isInterrupted()) {
587-
// If source is not running and thread is interrupted this means someone has tried to
588-
// remove this peer.
589-
return;
590-
}
591-
retryStartup.set(!this.abortOnError);
592-
throw new IllegalStateException("Source should be active.");
583+
return;
593584
}
585+
594586
LOG.info("{} queueId={} (queues={}) is replicating from cluster={} to cluster={}", logPeerId(),
595587
this.replicationQueueInfo.getQueueId(), logQueue.getNumQueues(), clusterId, peerClusterId);
596588
initializeWALEntryFilter(peerClusterId);

0 commit comments

Comments
 (0)