dstandish commented on a change in pull request #19546:
URL: https://github.com/apache/airflow/pull/19546#discussion_r748671412



##########
File path: airflow/jobs/triggerer_job.py
##########
@@ -148,6 +149,25 @@ def load_triggers(self):
         ids = Trigger.ids_for_triggerer(self.id)
         self.runner.update_triggers(set(ids))
 
+    @provide_session
+    def purge_completed_triggers_list(self, session):

Review comment:
       it would be nice if we didn't have to query tthe database here but i 
don't think it can be avoided.
   
   i explored updating `clean_unused` to return the `ids` deleted.  then we 
could pass those to `purge_completed` and purge those rows.  but this won't 
work because `clean_unused` does not filter w.r.t. triggerer_id, so other 
triggerer instances could delete the rows belonging to _this_ triggerer, so 
`completed_triggers` would grow over time.
   
   on the bright side, we're querying a PK, so it shouldn't be that expensive.




-- 
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-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to