Skip to content

Add admin page for batched background migrations

Heinrich Lee Yu requested to merge 326760-batched-migrations-admin-panel into master

What does this MR do?

Adds a page in the admin section to show the current progress of batched background migrations

Queries

Query for successful rows per migration
SELECT "batched_background_migration_jobs"."batched_background_migration_id", SUM(batch_size) AS successful_rows
FROM "batched_background_migration_jobs"
WHERE "batched_background_migration_jobs"."status" = 3 AND 
  "batched_background_migration_jobs"."batched_background_migration_id" IN (1, 2, 3)
GROUP BY "batched_background_migration_jobs"."batched_background_migration_id"
Time: 48.262 ms  
  - planning: 0.994 ms  
  - execution: 47.268 ms  
    - I/O read: 41.324 ms  
    - I/O write: N/A  
  
Shared buffers:  
  - hits: 30 (~240.00 KiB) from the buffer pool  
  - reads: 200 (~1.60 MiB) from the OS file cache, including disk I/O  
  - dirtied: 0  
  - writes: 0  
 Aggregate  (cost=0.29..1050.01 rows=7 width=16) (actual time=43.069..47.182 rows=3 loops=1)
   Group Key: batched_background_migration_jobs.batched_background_migration_id
   Buffers: shared hit=30 read=200
   I/O Timings: read=41.324
   ->  Index Scan using index_batched_jobs_on_batched_migration_id_and_status on public.batched_background_migration_jobs  (cost=0.29..1003.58 rows=9271 width=12) (actual time=7.929..45.370 rows=9248 loops=1)
         Index Cond: ((batched_background_migration_jobs.batched_background_migration_id = ANY ('{1,2,3}'::bigint[])) AND (batched_background_migration_jobs.status = 3))
         Buffers: shared hit=30 read=200
         I/O Timings: read=41.324

Screenshots (strongly suggested)

Screen_Shot_2021-05-05_at_10.15.22_AM

Screen_Shot_2021-05-05_at_10.15.30_AM

Screen_Shot_2021-05-05_at_10.15.35_AM

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Related to #326760 (closed)

Edited by Heinrich Lee Yu

Merge request reports