[PP-2233] Prevent deadlocks in axis.import_identifiers and axis.reap_… #2330
+69
−50
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…collection
Description
This update does the same two things for the reap collections and import collections methods to try to address the deadlock issue.
The deadlocks seem to be arising because all the CM's axis collections are being reaped and imported in parallel. As a result when the data they are updating overlap - such us updates to an edition's publish - it is easy for one of many collections to get into a database deadlock conflict with another.
To try to address this problem I've done 3 things:
Also added some logging to see the elapsed time and the number of items processed in one message.
We may need to fine tune the
subtask_execution_interval_in_secs
and/or the batch size in order to find the right balance.Motivation and Context
https://ebce-lyrasis.atlassian.net/browse/PP-2233
How Has This Been Tested?
Checklist