Skip to content

skip_archive should actually skip archive in db clean command #42003

Closed

Description

@dstandish

Body

Currently the delete process uses the archive table in the process of deletion. But we should refactor this so it doesn't need this and actually not create the archive table at all when user specifies this option.

The issue is when you are deleting a lot of rows, particularly if you have a low statement timeout, you may hit errors.

Committer

  • I acknowledge that I am a maintainer/committer of the Apache Airflow project.

Activity

  1. added
    kind:meta
    on Sep 4, 2024
  2. added
    area:db-migrations
    kind:feature
    on Sep 4, 2024
  3. phanikumv commented on Sep 4, 2024

    @phanikumv
    Contributor
  4. pratik-m commented on Sep 6, 2024

    @pratik-m

    Hi @phanikumv - can you pls assign this issue to me? I'd like to work on this.

  5. VETREA commented on Sep 10, 2024

    @VETREA

    @phanikumv
    can i work on this issue

  6. phanikumv commented on Sep 11, 2024

    @phanikumv
    Contributor

    @VETREA you might want to collaborate with @pratik-m

  7. VETREA commented on Sep 12, 2024

    @VETREA

    @pratik-m
    can i work with you on this same issue

  8. widewing commented on Mar 11, 2025

    @widewing

    @pratik-m are you still working on this issue? the related PR is closed.

  9. SeleniumK commented on Feb 28, 2026

    @SeleniumK

    Bumping this thread -- Also encountering the issue that '--skip-archive' does not skip writing archive tables

  10. potiuk commented on Mar 2, 2026

    @potiuk
    Member

    @pratik-m We are unassigning you from this issue as part of our updated assignment policy.

    This is not meant to discourage your contribution — quite the opposite! You are still very welcome to work on this issue and submit a PR for it. Simply comment that you are working on it and open a PR when ready.

    We found that formal assignments were not working well, as they often prevented others from contributing when the assignee was not actively working on the issue.

  11. rohankumardubey commented on Sep 4, 2026

    @rohankumardubey

    Hi @jinoo7099 , I saw that #67187 was closed. Are you planning to continue or reopen it? If not, I’d be happy to pick up #42003 and implement it against current main.

    cc: @potiuk

  12. sshari94 commented on Oct 22, 2026

    @sshari94

    Hi, I'd like to work on this if no one else is.

    Plan: when skip_archive is set, airflow db clean will delete the matching rows directly instead of first copying them into an _airflow_deleted__* table and dropping it. The same filters, keep-last logic, batching and skip_if_referenced behaviour will stay. I'll add tests that check no archive table is created and that the right rows are deleted.

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

    area:db-migrationsgood first issuekind:featurekind:meta

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions