Ignore dublicate of a compaction file
This commit is contained in:
committed by
Balaji Varadarajan
parent
e0ab89b3ac
commit
baea4f3b82
@@ -150,11 +150,18 @@ public class CompactionUtils {
|
|||||||
pendingCompactionPlanWithInstants.stream().flatMap(instantPlanPair -> {
|
pendingCompactionPlanWithInstants.stream().flatMap(instantPlanPair -> {
|
||||||
return getPendingCompactionOperations(instantPlanPair.getKey(), instantPlanPair.getValue());
|
return getPendingCompactionOperations(instantPlanPair.getKey(), instantPlanPair.getValue());
|
||||||
}).forEach(pair -> {
|
}).forEach(pair -> {
|
||||||
// Defensive check to ensure a single-fileId does not have more than one pending compaction
|
// Defensive check to ensure a single-fileId does not have more than one pending compaction with different
|
||||||
|
// params. If we find a full dub we assume it is caused by eventual nature of the move operation on some DFSs.
|
||||||
if (fgIdToPendingCompactionWithInstantMap.containsKey(pair.getKey())) {
|
if (fgIdToPendingCompactionWithInstantMap.containsKey(pair.getKey())) {
|
||||||
String msg = "Hoodie File Id (" + pair.getKey() + ") has more thant 1 pending compactions. Instants: "
|
HoodieCompactionOperation operation = pair.getValue().getValue();
|
||||||
+ pair.getValue() + ", " + fgIdToPendingCompactionWithInstantMap.get(pair.getKey());
|
HoodieCompactionOperation anotherOperation =
|
||||||
throw new IllegalStateException(msg);
|
fgIdToPendingCompactionWithInstantMap.get(pair.getKey()).getValue();
|
||||||
|
|
||||||
|
if (!operation.equals(anotherOperation)) {
|
||||||
|
String msg = "Hoodie File Id (" + pair.getKey() + ") has more thant 1 pending compactions. Instants: "
|
||||||
|
+ pair.getValue() + ", " + fgIdToPendingCompactionWithInstantMap.get(pair.getKey());
|
||||||
|
throw new IllegalStateException(msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
fgIdToPendingCompactionWithInstantMap.put(pair.getKey(), pair.getValue());
|
fgIdToPendingCompactionWithInstantMap.put(pair.getKey(), pair.getValue());
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user