n3nash commented on a change in pull request #651: Spark Stage retry handling
URL: https://github.com/apache/incubator-hudi/pull/651#discussion_r279572960
##########
File path: hoodie-client/src/main/java/com/uber/hoodie/table/HoodieTable.java
##########
@@ -263,20 +269,135 @@ public HoodieActiveTimeline getActiveTimeline() {
* @param stats List of HoodieWriteStats
* @throws HoodieIOException if some paths can't be finalized on storage
*/
- public void finalizeWrite(JavaSparkContext jsc, List<HoodieWriteStat> stats)
+ public void finalizeWrite(JavaSparkContext jsc, String instantTs,
List<HoodieWriteStat> stats)
throws HoodieIOException {
- if (config.isConsistencyCheckEnabled()) {
- List<String> pathsToCheck = stats.stream()
- .map(stat -> stat.getTempPath() != null
- ? stat.getTempPath() : stat.getPath())
- .collect(Collectors.toList());
-
- List<String> failingPaths = new ConsistencyCheck(config.getBasePath(),
pathsToCheck, jsc,
- config.getFinalizeWriteParallelism())
- .check(MAX_CONSISTENCY_CHECKS,
INITIAL_CONSISTENCY_CHECK_INTERVAL_MS);
- if (failingPaths.size() > 0) {
- throw new HoodieIOException("Could not verify consistency of paths : "
+ failingPaths);
+ rollbackFailedWrites(jsc, instantTs, stats,
config.isConsistencyCheckEnabled());
Review comment:
Calling rollback in finalizeWrite sounds weird, either we should rename
`rollbackFailedWrites` to `cleanFailedWrites` or call `rollbackFailedWrites` in
the constructor.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services