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
8aa3304427
commit
c92dd28a88
|
@ -496,11 +496,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