ashb commented on code in PR #66463:
URL: https://github.com/apache/airflow/pull/66463#discussion_r3201662393


##########
airflow-core/src/airflow/migrations/versions/0112_3_3_0_add_task_state_and_asset_state_tables.py:
##########
@@ -65,6 +65,11 @@ def upgrade():
         sa.Column("run_id", StringID(), nullable=False),
         sa.Column("value", sa.Text().with_variant(mysql.MEDIUMTEXT(), 
"mysql"), nullable=False),
         sa.Column("updated_at", UtcDateTime(), nullable=False),
+        # Optional early-expiry override. When set, GC deletes this row when 
expires_at < now()
+        # even if updated_at is recent. NULL means no early expiry — the row 
is still cleaned
+        # up by the global updated_at + default_retention_days check. 
Populated via

Review Comment:
   This is confusing IMO -- an `expires_at` of None should mean it never 
expires.
   
   We can pre-compute the expires_at value at update time by reading the 
default_retention config then (i.e. cleanup becomes a simpler "SELECT where 
expires_at < Now()`.
   
   This possibly also removes the need for an index on udpated_at.



-- 
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