Skip to content

Draft: Add CI partitioning creation automation

Max Orefice requested to merge morefice/add-ci-partitioning-automation into master

Ref: #454976

What does this MR do and why?

This MR explores how we can automatically creates new partition for CI tables.

Testing

Open a new console and run the following commands:

  1. Have existing partition records in your environment
  2. Enable the feature flag
  3. Reduce Ci::Partition::MAX_PARTITION_SIZE to a lower value ( eg: 1.byte)
  4. Run sync_partitions command to create new partition
=> Ci::Partition.create!(id: 100, status: 4)
=> Ci::Partition.create!(id: 101, status: 3)
=> Feature.enable(:ci_partitioning_automation)
=> Ci::Partition.next!
=> Ci::Partition.next.prepare!
=> Gitlab::Database::Partitioning.sync_partitions
=> Ci::Partition.next.ready!
Edited by Max Orefice

Merge request reports