Create BBO models

What does this MR do and why?

Creates tables and rails models to support BBO framework.

Tables:

  • background_operation_workers
  • background_operation_jobs
  • background_operation_workers_cell_local
  • background_operation_jobs_cell_local

NOTE:

  • Attributes in background operation worker tables are mostly same as in batched_background_migrations.
    • Currently in BBM next_min_cursor is computed from the jobs table, but it is denormalized and moved within worker table here. So that jobs partitions can be safely dropped once they are completed.
  • Attributes in background operation job tables are mostly same as in batched_background_jobs
  • Tables are partitioned with a retention period (for non-executables) of 14 days. So that the growth will be contained.

References

  • Epic: &16152
  • Discussion on table naming and model structure can be found in !203234 (comment 2734378527).
  • Discussion on partitioning technique can be found in !199587 (comment 2687529315).
  • Discussion on splitting the tables into cell-local and org specific can be found in #562947 (comment 2743808869).
    • The same thread also contains why UUID is chosen, so that it'll be uniq between databases (main, ci) and we don't have explicitly maintain it to make the sequences uniq.

Screenshots or screen recordings

Before After

How to set up and validate locally

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #542944 (closed)

Edited by Prabakaran Murugesan

Merge request reports

Loading