Skip to content

fix(reindex): Fix deadlocks for sub-resources#930

Merged
viacheslavkol merged 4 commits intomasterfrom
deadlocks-improvements
Apr 7, 2026
Merged

fix(reindex): Fix deadlocks for sub-resources#930
viacheslavkol merged 4 commits intomasterfrom
deadlocks-improvements

Conversation

@viacheslavkol
Copy link
Copy Markdown
Contributor

@viacheslavkol viacheslavkol commented Apr 3, 2026

Purpose

Fix deadlocks for sub-resources on reindex.
Reindex is unstable and not predictable. It could finish in 4 hours or it could run for 10 hours depending on deadlock occurrence.

Approach

  • Add ON CONFLICT DO NOTHING instead of update for sub-resources batch saving on reindexing
  • Remove unnecessary deletion/filtering operation from ChildResourceExtractor for reindexing

Changes Checklist

  • API Changes: Document any API paths, methods, request or response bodies changed, added, or removed.
  • Database Schema Changes: Indicate any database schema changes and their impact. Confirm that migration scripts were created.
  • Interface Version Changes: Indicate any changes to interface versions.
  • Interface Dependencies: Document added or removed dependencies.
  • Permissions: Document any changes to permissions.
  • Logging: Confirm that logging is appropriately handled.
  • Unit Testing: Confirm that changed classes were covered by unit tests.
  • Integration Testing: Confirm that changed logic was covered by integration tests.
  • Manual Testing: Confirm that changes were tested on local or dev environment.
  • NEWS: Confirm that the NEWS file is updated with relevant information about the changes made in this pull request.

Related Issues

PERF-1236

- Add ON CONFLICT DO NOTHING instead of update for sub-resources batch saving
- Remove unnecessary deletion/filtering operation from ChildResourceExtractor for reindexing

Refs: MSEARCH-1178
@viacheslavkol viacheslavkol self-assigned this Apr 6, 2026
@viacheslavkol viacheslavkol marked this pull request as ready for review April 6, 2026 17:19
@viacheslavkol viacheslavkol requested a review from a team as a code owner April 6, 2026 17:19
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 6, 2026

Quality Gate Failed Quality Gate failed

Failed conditions
13.2% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@viacheslavkol viacheslavkol merged commit a8ab70a into master Apr 7, 2026
15 of 16 checks passed
@viacheslavkol viacheslavkol deleted the deadlocks-improvements branch April 7, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants