Geo: Remove transaction lock in ProjectRepository
What does this MR do and why?
Removes the prevent_concurrent_inserts advisory lock callback from Geo::ProjectRepositoryState.
This is step 4 (Milestone 3) of the deduplication implementation plan for project_repository_states. The advisory lock was introduced in Milestone 1 to prevent duplicate records during concurrent inserts. Milestone 2 (released in 18.11, a required stop) deduplicated existing records and replaced the non-unique index with a unique index on project_repository_id.
Now that the unique database constraint is in place, the advisory lock is no longer needed and can be safely removed per the deduplication strategy documentation.
References
- Closes #590459 (closed)
- Deduplication migration:
db/post_migrate/20260316153056_deduplicate_project_repository_states.rb - Unique index migration:
db/post_migrate/20260317141445_add_unique_index_to_project_repository_states.rb
Screenshots or screen recordings
Not applicable — no UI changes.
| Before | After |
|---|---|
How to set up and validate locally
- Verify the unique index exists on
project_repository_states.project_repository_id:ActiveRecord::Base.connection.indexes(:project_repository_states).map(&:name) # Should include 'unique_index_project_repository_states_on_project_repository_id' - Confirm
Geo::ProjectRepositoryStateno longer callsprevent_concurrent_insertsbefore validation.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.