Skip to content

WIP: Update CarrierWave v2.0.2

Stan Hu requested to merge sh-update-carrierwave into master

CarrierWave v2.0.2 has a significant change where object storage uploads are handled outside of the database transaction (https://github.com/carrierwaveuploader/carrierwave/pull/2209). This should alleviate some idle-in-transaction timeouts.

Before

Uploads

graph LR
  A[Projects::UploadsController#create] --> B[CarrierWave: Save file to object storage]
  B --> C[BEGIN]
  C --> D["INSERT INTO uploads (file_store = 2) ..."]
  D --> E[COMMIT]

LFS

graph LR
  A[Projects::LfsStorageController#upload_finalize] --> B[BEGIN]
  B --> C["INSERT INTO lfs_objects ..."]
  C --> D[CarrierWave: Save file to object storage]
  D --> E["UPDATE lfs_objects SET file_store = 2 ..."]
  E --> F[COMMIT]

CI Artifacts

graph LR
  A["POST /api/v4/jobs/:job_id/artifacts"] --> B[BEGIN]
  B --> C[INSERT INTO ci_job_artifacts]
  C --> D[CarrierWave: Save file to object storage]
  D --> E["UPDATE ci_job_artifacts SET file_store = 2 ..."]
  E --> F[COMMIT]

After

Uploads

Same as before

LFS

graph LR
  A[Projects::LfsStorageController#upload_finalize] --> B[BEGIN]
  B --> C["INSERT INTO lfs_objects ..."]
  C --> D[COMMIT]
  D --> E[CarrierWave: Save file to object storage]
  E --> F["UPDATE lfs_objects SET file_store = 2 ..."]

CI Artifacts

graph LR
  A["POST /api/v4/jobs/:job_id/artifacts"] --> B[BEGIN]
  B --> C[INSERT INTO ci_job_artifacts]
  C --> D[COMMIT]
  D --> E[CarrierWave: Save file to object storage]
  E --> F["UPDATE ci_job_artifacts SET file_store = 2 ..."]

Relates to #34091 (closed)

Edited by Stan Hu

Merge request reports