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:
Pankaj 2020-04-10 05:10:15 +05:30 committed by GitHub
parent 8aa3304427
commit c92dd28a88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -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) {