[
https://issues.apache.org/jira/browse/GOBBLIN-1994?focusedWorklogId=902743&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-902743
]
ASF GitHub Bot logged work on GOBBLIN-1994:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 30/Jan/24 19:04
Start Date: 30/Jan/24 19:04
Worklog Time Spent: 10m
Work Description: Will-Lo commented on code in PR #3870:
URL: https://github.com/apache/gobblin/pull/3870#discussion_r1471799258
##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergDataset.java:
##########
@@ -188,11 +215,19 @@ protected Map<Path, FileStatus>
getFilePathsToFileStatus(FileSystem targetFs, Co
this.getFileSetId(), currentSnapshotOverview.getSnapshotId(),
currentSnapshotOverview.getManifestListPath(),
currentSnapshotOverview.getMetadataPath().orElse("<<ERROR:
MISSING!>>"));
- return Maps.newHashMap();
+ TableMetadata readTimeTableMetadata =
currentSnapshotOverview.getTableMetadata().orElseThrow(() -> new
RuntimeException(
+ String.format("~%s~ no table metadata for current snapshot '%s' at
'%s' with metadata path '%s'",
+ this.getFileSetId(), currentSnapshotOverview.getSnapshotId(),
+ currentSnapshotOverview.getManifestListPath(),
+ currentSnapshotOverview.getMetadataPath().orElse("<<ERROR:
MISSING!>>"))));
+ return new GetFilePathsToFileStatusResult(Maps.newHashMap(),
readTimeTableMetadata);
}
+
+ List<TableMetadata> readTimeTableMetadataHolder = Lists.newArrayList(); //
expecting exactly one elem
Iterator<IcebergSnapshotInfo> icebergIncrementalSnapshotInfos =
icebergTable.getIncrementalSnapshotInfosIterator();
Iterator<String> filePathsIterator = Iterators.concat(
Iterators.transform(icebergIncrementalSnapshotInfos, snapshotInfo -> {
+
snapshotInfo.getTableMetadata().ifPresent(readTimeTableMetadataHolder::add);
// log each snapshot, for context, in case of
`FileNotFoundException` during `FileSystem.getFileStatus()`
String manListPath = snapshotInfo.getManifestListPath();
log.info("~{}~ loaded snapshot '{}' at '{}' from metadata path:
'{}'", this.getFileSetId(),
Review Comment:
To understand this PR a bit, we are logging out the paths of each snapshot
here, so we should be able to detect when a replication has mismatched metadata
at this point?
##########
gobblin-data-management/src/main/java/org/apache/gobblin/data/management/copy/iceberg/IcebergDataset.java:
##########
@@ -126,6 +129,14 @@ protected Iterator<FileSet<CopyEntity>>
createFileSets(FileSystem targetFs, Copy
return Iterators.singletonIterator(fileSet);
}
+ /** Conveys {@link Path}-to-{@link FileStatus} mapping in combination with
{@link TableMetadata} originating from the same atomic read of those paths */
+ @Data
+ @VisibleForTesting
+ protected static final class GetFilePathsToFileStatusResult {
Review Comment:
Does it make sense to call this `IcebergTableFileMetadata`? Wondering if
we're being a bit explicit here
Issue Time Tracking
-------------------
Worklog Id: (was: 902743)
Time Spent: 40m (was: 0.5h)
> Ensure iceberg-distcp replication consistency
> ---------------------------------------------
>
> Key: GOBBLIN-1994
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1994
> Project: Apache Gobblin
> Issue Type: Bug
> Components: gobblin-core
> Reporter: Kip Kohn
> Assignee: Abhishek Tiwari
> Priority: Major
> Time Spent: 40m
> Remaining Estimate: 0h
>
> Ensure iceberg-distcp consistency by using same `TableMetadata` for both WU
> planning and final commit
--
This message was sent by Atlassian Jira
(v8.20.10#820010)