singhpk234 commented on code in PR #17984:
URL: https://github.com/apache/iceberg/pull/17984#discussion_r3954291415


##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -499,10 +533,14 @@ public void commit() {
                   if (base.snapshot(newSnapshot.snapshotId()) != null) {
                     // this is a rollback operation
                     update.setBranchSnapshot(newSnapshot.snapshotId(), 
targetBranch);
-                  } else if (stageOnly) {
-                    update.addSnapshot(newSnapshot);
                   } else {
-                    update.setBranchSnapshot(newSnapshot, targetBranch);
+                    // add the snapshot and its manifest list keys in the same 
metadata update
+                    manifestListKeys.forEach(update::addEncryptionKey);

Review Comment:
   we are adding KEK and MLK both here right ?



##########
core/src/main/java/org/apache/iceberg/SnapshotProducer.java:
##########
@@ -365,7 +375,31 @@ public Snapshot apply() {
         manifestList.location(),
         nextRowId,
         assignedRows,
-        writer.toManifestListFile().encryptionKeyID());
+        manifestListFile.encryptionKeyID());
+  }
+
+  private static List<EncryptedKey> findManifestListKeys(
+      EncryptionManager encryption, String manifestListKeyId) {

Review Comment:
   can we have better name for this function ? it returns both KEK and MLK 



-- 
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]

Reply via email to