HDFS-13731. ReencryptionUpdater fails with ConcurrentModificationException during processCheckpoints. Contributed by Zsolt Venczel.
This commit is contained in:
parent
c5629d546d
commit
3e18b957eb
|
@ -714,10 +714,10 @@ public class ReencryptionHandler implements Runnable {
|
|||
zst = new ZoneSubmissionTracker();
|
||||
submissions.put(zoneId, zst);
|
||||
}
|
||||
}
|
||||
Future future = batchService.submit(new EDEKReencryptCallable(zoneId,
|
||||
currentBatch, reencryptionHandler));
|
||||
zst.addTask(future);
|
||||
}
|
||||
LOG.info("Submitted batch (start:{}, size:{}) of zone {} to re-encrypt.",
|
||||
currentBatch.getFirstFilePath(), currentBatch.size(), zoneId);
|
||||
currentBatch = new ReencryptionBatch(reencryptBatchSize);
|
||||
|
|
|
@ -383,6 +383,7 @@ public final class ReencryptionUpdater implements Runnable {
|
|||
final LinkedList<Future> tasks = tracker.getTasks();
|
||||
final List<XAttr> xAttrs = Lists.newArrayListWithCapacity(1);
|
||||
ListIterator<Future> iter = tasks.listIterator();
|
||||
synchronized (handler) {
|
||||
while (iter.hasNext()) {
|
||||
Future<ReencryptionTask> curr = iter.next();
|
||||
if (curr.isCancelled()) {
|
||||
|
@ -403,13 +404,14 @@ public final class ReencryptionUpdater implements Runnable {
|
|||
xAttrs.clear();
|
||||
xAttrs.add(xattr);
|
||||
} catch (IOException ie) {
|
||||
LOG.warn("Failed to update re-encrypted progress to xattr for zone {}",
|
||||
zonePath, ie);
|
||||
LOG.warn("Failed to update re-encrypted progress to xattr" +
|
||||
" for zone {}", zonePath, ie);
|
||||
++task.numFailures;
|
||||
}
|
||||
++tracker.numCheckpointed;
|
||||
iter.remove();
|
||||
}
|
||||
}
|
||||
if (tracker.isCompleted()) {
|
||||
LOG.debug("Removed re-encryption tracker for zone {} because it completed"
|
||||
+ " with {} tasks.", zonePath, tracker.numCheckpointed);
|
||||
|
|
Loading…
Reference in New Issue