diff options
author | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2021-07-01 10:33:25 +0300 |
---|---|---|
committer | Quang-Minh Nguyen <qmnguyen@gitlab.com> | 2021-07-14 12:49:51 +0300 |
commit | 4d6d21999ed4e70c84f8e754adacb4f6204ca0b0 (patch) | |
tree | ba1ffe579874b5cd3e6f565000d51d9d8402f297 /doc | |
parent | 47164700a1ea086c5e8ca0d02feefe4e68bf4f81 (diff) |
Add documentation for pack-object cache
Changelog: other
Diffstat (limited to 'doc')
-rw-r--r-- | doc/design_pack_objects_cache.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/doc/design_pack_objects_cache.md b/doc/design_pack_objects_cache.md index c104380db..a44a67679 100644 --- a/doc/design_pack_objects_cache.md +++ b/doc/design_pack_objects_cache.md @@ -6,6 +6,37 @@ The purpose of this document is to give more insight into the design choices we Please read the [administrator documentation for the pack-objects cache](https://docs.gitlab.com/ee/administration/gitaly/configure_gitaly.html#pack-objects-cache) if you are not already familiar with what it does or what it is for. +Please read [Pack-objects cache for CI Git clones epic](https://gitlab.com/groups/gitlab-com/gl-infra/-/epics/372) for more information about Pack-objects cache. + +## High-level architecture + +``` +Gitaly (PostUploadPack) git-upload-pack gitaly-hooks Gitaly (PackObjectsHook) git-pack-objects +------------+---------- -------+------- -----+------ -----------+------------ -------+-------- + | fetch request | | | | + +------------------>| pack request | | | + | +------------->| gRPC request | | + | | +------------------>| pack request (miss) | + | | | +-------------------->| + | | | | | + | | | |<--------------------+ + | | |<------------------+ packfile data | + | |<-------------+ gRPC response | | + |<------------------+ packfile data| | | + | fetch response | | | | + | | | | | +------------+---------- -------+------- -----+------ -----------+------------ -------+-------- +Gitaly (PostUploadPack) git-upload-pack gitaly-hooks Gitaly (PackObjectsHook) git-pack-objects +``` + +The whole pack-objects cache path depends on +[uploadpack.packObjectsHook](https://git-scm.com/docs/git-config#Documentation/git-config.txt-uploadpackpackObjectsHook) +option. When upload-pack would run git pack-objects to create a packfile for a +client, it will run `gitaly-hooks` binary instead. The arguments when calling +`gitaly-hooks` includes `git pack-objects` at the beginning. This pattern is +similar to how Gitaly handles Git hooks during a push (such as `pre-preceive` +and `post-receive`). + ## Problem scope We designed this cache to solve a specific problem on GitLab.com: high |