Skip to content

Assign pooled repositories to the same partition as the pool

Sami Hiltunen requested to merge smh-object-pool-partitioning into master

Pooled repositories need to be in the same partition as the pool itself to order the operations between them for consistency. This commit extends the partitionAssigner to handle this.

When assigning a repository into a partition, the repository's objects/info/alternates file is read to see if this repository is linked to a pool. If so, the repository will be assigned into the same partition as the pool. If the pool hasn't yet been assigned into a partition, it will be assigned into a partition first.

There's extended validation to ensure the alternate points to a valid repository. The validation is more for sanity checking and the logic would generally work fine even if the path in the alternates pointed to an invalid location. We'd end up creating a partition assignment for a repository that doesn't exist. Not critical but doing the sanity checks likely doesn't hurt and will help us find weird state if we encounter it.

Merge request reports