Skip to content

gitaly: Introduce partition managers

Justin Tobler requested to merge jt-partition-manager into master

This change introduces the PartitionManager which handles the lifecycle of each repository's TransactionManager. As it is not feasible to keep running workers for each repository, the parition manager keeps track of pending transactions and starts/stops transaction managers as needed. Each repository will at most have a single transaction manager for processing transactions.

When partitionManager.Begin() is invoked, the partition manager checks if there is already a running transaction manager for the repository. If not, one is started. Then a transaction is generated and transaction counter incremented.

When the transaction is committed or rolled back, the transactionFinalizer() is invoked which calls back to the partition mananger to decrement the transaction count and shutdown the transaction manager if there are no longer any pending transactions for the repository.

Edited by Justin Tobler

Merge request reports