Skip to content

Implement partition assignment logic

Sami Hiltunen requested to merge smh-partition-assignments into master

Gitaly's write-ahead log will be partitioned. Most repositories will live in their own partition with their own write-ahead log. So far determining the repository's partition based on its relative path was sufficient.

In order to support object pools with the write-ahead log, we need to store the pool and the member repositories in the same partition so operations targeting them are ordered. Each of these repositories will have different relative paths so its no longer possible to determine the repository's partition purely from its relative path. Determining the partitition from the pool's relative path alone is not sufficient either as the repository must remain in the same partition even if it was unlinked from the pool.

To support multiple repositories in a partition, this commit implements partition assignment logic. When a repository is first accessed with the write-ahead logging enabled, a new partition ID will be allocated for it and stored in the database. Subsequent accesses will find the partition assignment from the database and route the transactions to the correct partition.

Closes ##5518 (closed)

Merge request reports