RHGitaly as unique entry point
Motivation
The prefork model of HGitaly is too limited, especially since we have or will have very long running requests. Some of these even depend on the bandwidth of external systems, meaning that we cannot just hope to improve performance on them. The most obvious examples being those in support of the future hg pull
over SSH (currently not going through HGitaly) or more immediately hg-pull
remote mirrors.
Also the RHGitaly support in the Rails application is hacky to say the least, and has the drawback of not being applied by Workhorse or things like gitaly-backup
.
The current setup has the drawback to force us to implement all options of a given method. This is even a timebomb, as new options that cannot be implemented in Rust can appear any time. Having a way to fall back dynamically like rhg
does would be much better.
To finish the enumeration, copying over a subset of the protocol is tedious and error-prone.
Steps
-
Acquire the capability to launch a separate hg
process (should already be enough to implement push/pull) -
Implement a separate HGitaly startup demonstration (using hg hgitaly-server --mono-process
on a Unix Socked domain). -
Generic fall back function or method on an existing HGitaly server (with its URL given to RHGitaly as configuration). Not acceptable for production because of Python worker overhead. The FindCommits
method would be a good demontstrator (e.g., fallback iffollow=true
). -
Dynamically growing and downscaling pool of HGitaly workers to avoid worker startup overhead. Downscaling should select workers for shutdown based on RAM usage and should avoid dropping requests (can be done with a worker status with values such as Available
,Starting
,ShuttingDown
). -
Implement the full protocols using the fallback system -
Deprecate the HGitaly prefork server, to keep in the long term only the run mode that is used by RHGitaly (mono-process mode on Unix Socket domains). -
Ship RHGitaly as the unique service in Omnibus and in source documentation; call it just hgitaly
.