stevenzwu commented on code in PR #15003:
URL: https://github.com/apache/iceberg/pull/15003#discussion_r2750214616
##########
core/src/test/java/org/apache/iceberg/TestCommitReporting.java:
##########
@@ -195,4 +195,68 @@ public void addAndDeleteManifests() {
assertThat(metrics.manifestsReplaced().value()).isEqualTo(2L);
assertThat(metrics.manifestEntriesProcessed().value()).isEqualTo(2L);
}
+
+ @TestTemplate
+ public void snapshotProducerManifestMetrics() {
Review Comment:
Instead of adding a new method that cover multiple scenarios, should the new
assertions just be added to exiting testing methods?
##########
core/src/main/java/org/apache/iceberg/ManifestMergeManager.java:
##########
@@ -200,8 +217,9 @@ private ManifestFile createManifest(int specId,
List<ManifestFile> bin) {
ManifestFile manifest = writer.toManifestFile();
- // update the cache
+ // update the cache and track replaced manifests
mergedManifests.put(bin, manifest);
+ replacedManifestsCount.addAndGet(bin.size());
Review Comment:
This is buried deep in the code path to update the replaced counter, which
is less clear about the intention. A better place might be inside the for loop
(line 86)
```
for (Integer specId : groups.keySet()) {
List<ManifestFile> toBeMerged = groups.get(specId);
replacedManifestsCount.addAndGet(toBeMerged);
Iterables.addAll(merged, mergeGroup(first, specId, toBeMerged));
}
```
##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -645,6 +645,35 @@ protected boolean cleanupAfterCommit() {
return true;
}
+ /**
Review Comment:
looks like it doesn't populate the kept manfiests count? maybe we can fix it
here.
##########
core/src/test/java/org/apache/iceberg/TestDeleteFiles.java:
##########
@@ -351,6 +351,62 @@ public void testDeleteFilesOnIndependentBranches() {
statuses(Status.EXISTING, Status.DELETED, Status.DELETED));
}
+ @TestTemplate
+ public void testDeleteFilesWithManifestSnapshotSummary() {
Review Comment:
should the new assertions be added to existing test methods like the
`TestFastAppend` change?
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]