wgtmac commented on code in PR #1104:
URL: https://github.com/apache/iceberg-cpp/pull/1104#discussion_r4624026932


##########
src/iceberg/transaction.cc:
##########
@@ -534,7 +621,40 @@ void Transaction::CleanupUpdates() noexcept {
 }
 
 void Transaction::FinalizeUpdates(const TableMetadata& committed) noexcept {
+  std::optional<std::unordered_set<std::string>> committed_files;
+  internal::LogAndIgnoreFailure("Transaction file discovery", [&]() -> Status {
+    std::unordered_set<int64_t> snapshot_ids;
+    for (const auto& change : ctx_->metadata_builder->changes()) {
+      if (change->kind() == TableUpdate::Kind::kAddSnapshot) {

Review Comment:
   You're right. This can leave orphaned staging files after an add-then-expire 
transaction. I'd prefer to address it in a follow-up, since the fix also needs 
to preserve expiration cleanup ordering and policies.



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