-
Bug
-
Resolution: Duplicate
-
Major
-
None
-
3
-
False
-
Moderate
-
Artemis Prioritized Backlog
-
sat-artemis
-
None
-
None
-
None
-
No Coverage
-
No
Description of problem:
This bug had been raised before in bug 2252297 but it was closed because it is hard to reproduce. Thus, I raise a new one for it.
The deadlock error happens when indexing contents of multiple repositories with many similar contents. This could be happened when publishing a content view (in index contents step) with those repositories. For example, RHEL 8 BaseOs and RHEL 8.x BaseOs repos
Steps to reproduce:
1. Create a content view
2. Add RHEL 8 BaseOs repo and multiple many RHEL 8.x BaseOs repositories to the content view.
3. Publish the content view.
Actual results:
ActiveRecord::Deadlocked (PG::TRDeadlockDetected: ERROR: deadlock detected)
DETAIL: Process 361390 waits for ShareLock on transaction 85433497; blocked by process 361035.
Process 361035 waits for ShareLock on transaction 85433498; blocked by process 361390.
HINT: See server log for query details.
CONTEXT: while inserting index tuple (1530,1) in relation "katello_errata"
Expected results
No Error
Additional info:
The reproducing steps might above might have low chance to reproduce the deadlock error. The higher chance I found is open multiple terminals and run the index errata concurrently.
For example:
Terminal 1:
~~~
Setting[:bulk_load_size] = 250
repo = Katello::ContentView.find(30).versions.last.archived_repos.where("relative_path ilike ?", '%baseos%').sort_by(&:id).first
type = repo.root.repository_type.content_types_to_index.find
10.times {Katello::ContentUnitIndexer.new(content_type: type, repository: repo, optimized: false).import_all; sleep 1}
~~~
Terminal 2:
~~~
Setting[:bulk_load_size] = 250
repo = Katello::ContentView.find(30).versions.last.archived_repos.where("relative_path ilike ?", '%baseos%').sort_by(&:id).second
type = repo.root.repository_type.content_types_to_index.find{|t| t.content_type == 'erratum'}
10.times
{Katello::ContentUnitIndexer.new(content_type: type, repository: repo, optimized: false).import_all; sleep 1}~~~
Terminal 3:
~~~
Setting[:bulk_load_size] = 250
repo = Katello::ContentView.find(30).versions.last.archived_repos.where("relative_path ilike ?", '%baseos%').sort_by(&:id).third
type = repo.root.repository_type.content_types_to_index.find
10.times
{Katello::ContentUnitIndexer.new(content_type: type, repository: repo, optimized: false).import_all; sleep 1}~~~
- duplicates
-
SAT-39998 Error while synchronizing concurrently RPM content - PG::TRDeadlockDetected: ERROR: deadlock detected
-
- Testing
-
-
SAT-37795 Error while synchronizing concurrently RPM content - PG::TRDeadlockDetected: ERROR: deadlock detected
-
- Release Pending
-
- relates to
-
SAT-39998 Error while synchronizing concurrently RPM content - PG::TRDeadlockDetected: ERROR: deadlock detected
-
- Testing
-
-
SAT-37795 Error while synchronizing concurrently RPM content - PG::TRDeadlockDetected: ERROR: deadlock detected
-
- Release Pending
-
- external trackers