Skip to content

BUG : Potential inconsistency during global reclustering due to lack of overall transaction #562

@Hemil36

Description

@Hemil36

Is there an existing issue for this?

  • I have searched the existing issues

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

  • I agree to follow this project's Code of Conduct

Checklist before Submitting

  • Have you updated docs for it?
  • Have you added unit tests?
  • Have you made sure unit tests pass?
  • Have you made sure code formatting is correct?
  • Do Your changes passes all tests?

Metadata

Metadata

Assignees

Labels

backendbugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions