You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "kaxil (via GitHub)" <gi...@apache.org> on 2026/07/03 09:13:44 UTC
[PR] Rename `state-store cleanup-task-state-store` command to `state-store clean` [airflow]
kaxil opened a new pull request, #69316:
URL: https://github.com/apache/airflow/pull/69316
The task state store cleanup command added in 3.3.0rc1, `airflow state-store cleanup-task-state-store`, repeats "state store" in both the command group and the subcommand. This renames it to `airflow state-store clean`, mirroring `airflow db clean`. The old name only appeared in 3.3.0rc1, so renaming before 3.3.0 keeps a single stable name.
```bash
# before
airflow state-store cleanup-task-state-store [--dry-run]
# after
airflow state-store clean [--dry-run]
```
Behavior is unchanged: it deletes `task_state_store` rows whose `expires_at` is in the past, honoring `[state_store] default_retention_days` and `state_cleanup_batch_size`.
## Why the command supports the metastore backend only
The command runs server-side against the metadata database and cleans only the default `MetastoreBackend`; custom backends are skipped with a message. This is deliberate: a custom state store backend is typically worker-side (e.g. object storage), and cleaning it correctly means removing both the metadata-DB refs and the backend data, in order. That has to run where the backend and its dependencies live (the worker), not on the server-side CLI. Broader retention management for custom/worker-side backends is follow-up work.
The help text and the two docs pages now state this restriction accurately instead of implying the command is generic across backends. The command docstring records the reasoning.
## Why no scope flag
The command only ever applies to task state. Asset state store has no time-based expiry: the `asset_state_store` table has no `expires_at` column, `[state_store] default_retention_days` explicitly excludes it, and asset rows are removed by the scheduler's orphan sweep when an asset is deactivated, not by a retention clock. A `--scope`-style flag would be permanently single-valued, so it is omitted; a flag can be added cleanly if a real second axis is ever needed.
## Also
Fixes a nonexistent class name in the docs (`MetastoreStateBackend` → `MetastoreBackend`).
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rename `state-store cleanup-task-state-store` command to `state-store clean` [airflow]
Posted by "vatsrahul1001 (via GitHub)" <gi...@apache.org>.
vatsrahul1001 merged PR #69316:
URL: https://github.com/apache/airflow/pull/69316
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] Rename `state-store cleanup-task-state-store` command to `state-store clean` [airflow]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #69316:
URL: https://github.com/apache/airflow/pull/69316#issuecomment-4875025990
### Backport successfully created: v3-3-test
Note: As of [Merging PRs targeted for Airflow 3.X](https://github.com/apache/airflow/blob/main/dev/README_AIRFLOW3_DEV.md#merging-prs-targeted-for-airflow-3x)
the committer who merges the PR is responsible for backporting the PRs that are bug fixes (generally speaking) to the maintenance branches.
In matter of doubt please ask in [#release-management](https://apache-airflow.slack.com/archives/C03G9H97MM2) Slack channel.
<table>
<tr>
<th>Status</th>
<th>Branch</th>
<th>Result</th>
</tr>
<tr>
<td>✅</td>
<td>v3-3-test</td>
<td><a href="https://github.com/apache/airflow/pull/69322"><img src="https://img.shields.io/badge/PR-69322-blue" alt="PR Link"></a></td>
</tr>
</table>
--
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: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org