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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to