Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: updated org model and sync registries to prevent locking organi… #1230

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

wwills2
Copy link
Collaborator

@wwills2 wwills2 commented Nov 22, 2024

this PR removes the organization model mutex aquisition intoduced in #1224. the sync-registries task a still acquires the mutex prior to inserting data into the audit table as part of a SQLite transaction, and the audit model checks the mutex before reads.

The update query to update the organization records with the latest registry hash has been moved outside of the audit update SQL transaction to prevent locking the organization table for the duration of the audit sync. Additional validation and correction logic has been added to address the newly decoupled nature of the audit and organization updates (they still happen synchronously relative to eachother, but they are now not part of the same transaction).

when the sync registries task runs, it checks to make sure the organization registry hash matches the latest audit record hash, and corrects the record on discrepancies.

@wwills2 wwills2 merged commit db5cc79 into develop Nov 22, 2024
13 checks passed
@wwills2 wwills2 deleted the audit-and-organization-db-locking-mitigation-v2 branch November 22, 2024 19:13
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.

1 participant