HBASE-24074 ConcurrentModificationException occured in ReplicationSourceManager while refreshing the peer (#1471)
Signed-off-by: Huaxiang Sun <huaxiangsun@apache.com> Signed-off-by: stack <stack@apache.org>
This commit is contained in:
parent
91aa3ce97c
commit
823cf97495
|
@ -400,11 +400,13 @@ public class ReplicationSourceManager implements ReplicationListener {
|
|||
// synchronized on oldsources to avoid race with NodeFailoverWorker
|
||||
synchronized (this.oldsources) {
|
||||
List<String> previousQueueIds = new ArrayList<>();
|
||||
for (ReplicationSourceInterface oldSource : this.oldsources) {
|
||||
for (Iterator<ReplicationSourceInterface> iter = this.oldsources.iterator(); iter
|
||||
.hasNext();) {
|
||||
ReplicationSourceInterface oldSource = iter.next();
|
||||
if (oldSource.getPeerId().equals(peerId)) {
|
||||
previousQueueIds.add(oldSource.getQueueId());
|
||||
oldSource.terminate(terminateMessage);
|
||||
this.oldsources.remove(oldSource);
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
for (String queueId : previousQueueIds) {
|
||||
|
|
Loading…
Reference in New Issue