-
- Downloads
Create worker to store security reports by project
Technical context ----------------------- `UPSERT` queries **require acquiring locks on unique index tuples**. This will cause lock contention if multiple processes try to `UPSERT` records with the same unique attributes. The lock contention will make each process wait for the other to complete. Historical context ----------------------- The `StoreSecurityReportsWorker` job has the lock-contention issue described above. It was discovered in [this][0] production incident This Commit ----------------------- The short-term solution resolves the lock contention by, in effect, making the jobs run sequentially. However, going through these jobs sequentially can take a long time ([somewhere][1] on the order of 3.25 hours to 20 hours) In this change, we implement a medium-term solution that replaces the problematic job with a similar job that can make use of our existing [sidekiq deduplication][2] tooling With this change, even if a single project suddenly has many pipelines created for it, only one job will be scheduled and the rest will be de-duplicated [0]:gitlab-com/gl-infra/production#17754 [1]:gitlab-com/gl-infra/production#17754 (comment 1831442417) [2]:https://docs.gitlab.com/ee/development/sidekiq/idempotent_jobs.html#deduplication related to: #452005 EE: true Changelog: fixed
parent
6c08589a
No related branches found
No related tags found
Showing
- doc/development/sec/security_report_ingestion_overview.md 2 additions, 2 deletionsdoc/development/sec/security_report_ingestion_overview.md
- ee/app/services/security/store_scans_service.rb 11 additions, 1 deletionee/app/services/security/store_scans_service.rb
- ee/app/workers/all_queues.yml 9 additions, 0 deletionsee/app/workers/all_queues.yml
- ee/app/workers/security/store_security_reports_by_project_worker.rb 50 additions, 0 deletions...kers/security/store_security_reports_by_project_worker.rb
- ee/app/workers/store_security_reports_worker.rb 1 addition, 0 deletionsee/app/workers/store_security_reports_worker.rb
- ee/config/feature_flags/gitlab_com_derisk/deduplicate_security_report_ingestion_jobs.yml 9 additions, 0 deletions...com_derisk/deduplicate_security_report_ingestion_jobs.yml
- ee/spec/services/security/store_scans_service_spec.rb 50 additions, 7 deletionsee/spec/services/security/store_scans_service_spec.rb
- ee/spec/workers/security/store_security_reports_by_project_worker_spec.rb 319 additions, 0 deletions...security/store_security_reports_by_project_worker_spec.rb
- spec/support/rspec_order_todo.yml 0 additions, 2 deletionsspec/support/rspec_order_todo.yml
- spec/workers/every_sidekiq_worker_spec.rb 1 addition, 0 deletionsspec/workers/every_sidekiq_worker_spec.rb
-
mentioned in merge request kubitus-project/kubitus-installer!3098 (merged)
Please register or sign in to comment