You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Delete files not eventually removed if RewriteDataFile run right after delete (when using 'use-starting-sequence-number' default) #4127
This RewriteDataFile flag value 'use-starting-sequence-number' (added and default true in #3480) seems to prevent delete files from getting cleaned up if these operations are run:
Delete from my_table where =
=> new delete_file has sequence number = n CALL %s.system.rewrite_data_files(table => my_table, options => map ('delete-file-threshold','1')
=> new data files have sequence_number = n, because starting sequence number = n
The only cleanup mechanism for delete files today is only when they have a sequence number less than all existing data files. So these delete files are not cleaned up in the subsequent operation (unlike if the flag was off and the rewritten files get the next sequence number n+1). As these data-files were just successfully re-written, it's doubtful their delete file can ever get cleaned up because further rewrites will probably skip these already-optimized data files. These delete files will stay until all these data files get deleted.
Reacted by Shqiprim Bunjaku, Prashant Singh, Yufei Gu, ignaski, Changhoon Oh and woowa-okayhooni
Not sure how common this will be in real life, but I think it is a bit of surprise to users trying to play with feature the first time.
Is the case that the flag solves (equality delete while rewrite-data-file happens) more common that default should be true? If so, maybe the only solution here is to implement the RemoveDanglingDeleteFiles Spark job in the design doc.
changed the title [-]RewriteDataFile flag 'use-starting-sequence-number' prevents delete file cleanup for deletes just before[/-][+]Delete files not eventually removed if RewriteDataFile run right after delete (when using 'use-starting-sequence-number' default)[/+]on Feb 15, 2022
@rdblue@aokolnychyi@RussellSpitzer@jackye1995 (or anyone else) fyi if any thoughts on this. Its probably not a huge issue as delete files will not apply, and we plan eventually to have removeDanglingDeleteFiles, but not sure if we need to document this for time being or any other quick fix.
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
Activity
szehon-ho commentedon Feb 15, 2022
Not sure how common this will be in real life, but I think it is a bit of surprise to users trying to play with feature the first time.
Is the case that the flag solves (equality delete while rewrite-data-file happens) more common that default should be true? If so, maybe the only solution here is to implement the RemoveDanglingDeleteFiles Spark job in the design doc.
[-]RewriteDataFile flag 'use-starting-sequence-number' prevents delete file cleanup for deletes just before[/-][+]Delete files not eventually removed if RewriteDataFile run right after delete (when using 'use-starting-sequence-number' default)[/+]coolderli commentedon Feb 16, 2022
I have a PR to solve this problem:#3990
szehon-ho commentedon Jun 22, 2022
Looks like more people hit this issue.
@rdblue @aokolnychyi @RussellSpitzer @jackye1995 (or anyone else) fyi if any thoughts on this. Its probably not a huge issue as delete files will not apply, and we plan eventually to have removeDanglingDeleteFiles, but not sure if we need to document this for time being or any other quick fix.
szehon-ho commentedon Oct 21, 2022
Note , plan to put a design doc up next week for this.
szehon-ho commentedon Nov 5, 2022
Design doc here: #6126
chenwyi2 commentedon Dec 6, 2023
@szehon-ho Is there a plan to deal with equality delete?
github-actions commentedon Aug 7, 2024
This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.
github-actions commentedon Aug 22, 2024
This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'