Is there an existing issue for this?
What happened?
Description
The function cluster_util_face_clusters_sync in backend/app/utils/face_clusters.py performs global face reclustering after 24 hours or 100 unclustered Images . It currently calls several database helper functions ( db_delete_all_clusters, db_insert_clusters_batch, db_update_face_cluster_ids_batch, db_update_metadata, etc.),each of which manages its own connection and transaction.
Because there is no overall transaction encompassing the entire reclustering workflow, the database can be left in a partially updated state if any step fails.
Example scenario:
-
Clusters are deleted successfully via db_delete_all_clusters()
-
Insertion of new clusters fails due to an exception in db_insert_clusters_batch()
-
Result: the system ends up with no clusters and invalid face assignments
Record
Checklist before Submitting
Is there an existing issue for this?
What happened?
Description
The function
cluster_util_face_clusters_syncinbackend/app/utils/face_clusters.pyperforms global face reclustering after 24 hours or 100 unclustered Images . It currently calls several database helper functions( db_delete_all_clusters, db_insert_clusters_batch, db_update_face_cluster_ids_batch, db_update_metadata, etc.),each of which manages its own connection and transaction.Because there is no overall transaction encompassing the entire reclustering workflow, the database can be left in a partially updated state if any step fails.
Example scenario:
Clusters are deleted successfully via db_delete_all_clusters()
Insertion of new clusters fails due to an exception in db_insert_clusters_batch()
Result: the system ends up with no clusters and invalid face assignments
Record
Checklist before Submitting