Nandor Kollar has posted comments on this change. ( https://gerrit.cloudera.org/25276 )
Change subject: IMPALA-15730: Fix DROP PARTITION truncating Iceberg tables ...................................................................... Patch Set 1: > Patch Set 1: > > (3 comments) > > Thanks for working on this. I also found some related issues, already opened > IMPALA-15483, but during the review, I was considering some others, some > possible concurrency problems. I would appreciate your thoughts on them. > Which ones do you think we should address here or open a separate Jira? > > Not introduced in this change, but a concurrency problem in case of the > TRUNCATE path: We decide to truncate based on the current snapshot but in > IcebergCatalogOpExecutor (L339), the snapshot is not checked. A concurrent > write could have already landed and this TRUNCATE does not take the new > snapshot into consideration, removing everything from the latest snapshot > (even the newly written files), which can lead to data loss. > > We should either consider checking for concurrent updates/conflicts or let go > of this truncate shortcut. > > > Also worth considering a concurrent (partial or total) compaction with the > general, selective DROP PARTITION case: > As far as I understand, we do not check for missing files at commit time in > the catalog. So it is possible that DROP PARTITION wants to remove the old > file, but it is already rewritten by the other job and the new file keeps the > rows that were intended to be removed. To be safe, we should delete files by > path with validateFilesExist() in the catalog, so that it throws an exception > that there is a conflict if the file is missing. That's correct, even after this change, data loss is still possible! The problem you mentioned is 100% there. Honestly, I'd remove this truncate shortcut, as it doesn't appear that we can easily fix it. In fact, I'm afraid we can only narrow the window where concurrent updates can cause data loss, but can't fully eliminate it. I'm not sure what do we win if we keep this shortcut, as there's already a separate statement for that. WDYT? -- To view, visit https://gerrit.cloudera.org/25276 To unsubscribe, visit https://gerrit.cloudera.org/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I47dd166a468f1ae038c36e052cfe24fbb9932a3c Gerrit-Change-Number: 25276 Gerrit-PatchSet: 1 Gerrit-Owner: Nandor Kollar <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Reviewer: Nandor Kollar <[email protected]> Gerrit-Reviewer: Noemi Pap-Takacs <[email protected]> Gerrit-Reviewer: Peter Rozsa <[email protected]> Gerrit-Comment-Date: Tue, 10 Nov 2026 08:43:44 +0000 Gerrit-HasComments: No
