Skip to content

Delete files not eventually removed if RewriteDataFile run right after delete (when using 'use-starting-sequence-number' default) #4127

Closed as not planned

Description

@szehon-ho

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.

Activity

  1. szehon-ho commented on Feb 15, 2022

    @szehon-ho
    MemberAuthor

    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.

  2. 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
  3. coolderli commented on Feb 16, 2022

    @coolderli
    Contributor

    I have a PR to solve this problem:#3990

  4. szehon-ho commented on Jun 22, 2022

    @szehon-ho
    MemberAuthor

    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.

  5. szehon-ho commented on Oct 21, 2022

    @szehon-ho
    MemberAuthor

    Note , plan to put a design doc up next week for this.

  6. szehon-ho commented on Nov 5, 2022

    @szehon-ho
    MemberAuthor

    Design doc here: #6126

  7. chenwyi2 commented on Dec 6, 2023

    @chenwyi2

    @szehon-ho Is there a plan to deal with equality delete?

  8. github-actions commented on Aug 7, 2024

    @github-actions

    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.

  9. github-actions commented on Aug 22, 2024

    @github-actions

    This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions