gitlab-org--gitlab-foss/doc/administration
Zeger-Jan van de Weg 896c0bdbfb
Allow public forks to be deduplicated
When a project is forked, the new repository used to be a deep copy of everything
stored on disk by leveraging `git clone`. This works well, and makes isolation
between repository easy. However, the clone is at the start 100% the same as the
origin repository. And in the case of the objects in the object directory, this
is almost always going to be a lot of duplication.

Object Pools are a way to create a third repository that essentially only exists
for its 'objects' subdirectory. This third repository's object directory will be
set as alternate location for objects. This means that in the case an object is
missing in the local repository, git will look in another location. This other
location is the object pool repository.

When Git performs garbage collection, it's smart enough to check the
alternate location. When objects are duplicated, it will allow git to
throw one copy away. This copy is on the local repository, where to pool
remains as is.

These pools have an origin location, which for now will always be a
repository that itself is not a fork. When the root of a fork network is
forked by a user, the fork still clones the full repository. Async, the
pool repository will be created.

Either one of these processes can be done earlier than the other. To
handle this race condition, the Join ObjectPool operation is
idempotent. Given its idempotent, we can schedule it twice, with the
same effect.

To accommodate the holding of state two migrations have been added.
1. Added a state column to the pool_repositories column. This column is
managed by the state machine, allowing for hooks on transitions.
2. pool_repositories now has a source_project_id. This column in
convenient to have for multiple reasons: it has a unique index allowing
the database to handle race conditions when creating a new record. Also,
it's nice to know who the host is. As that's a short link to the fork
networks root.

Object pools are only available for public project, which use hashed
storage and when forking from the root of the fork network. (That is,
the project being forked from itself isn't a fork)

In this commit message I use both ObjectPool and Pool repositories,
which are alike, but different from each other. ObjectPool refers to
whatever is on the disk stored and managed by Gitaly. PoolRepository is
the record in the database.
2018-12-07 19:18:37 +01:00
..
auth Support RSA and ECDSA algorithms in Omniauth JWT 2018-12-05 18:17:40 +01:00
gitaly Add documentation reference to gitaly-debug 2018-11-30 17:26:37 +00:00
high_availability Replace deprecated skip-auto-migrations occurrence 2018-11-23 15:44:27 +01:00
img Remove Git circuit breaker 2018-10-10 09:08:18 +02:00
integration Remove Koding integration and documentation 2018-10-12 22:18:51 -07:00
monitoring Remove broken link and fix markdown formatting 2018-11-30 09:07:14 +10:00
operations Resolve Markdown ordered lists not conforming to styleguide 2018-11-13 10:53:38 +10:00
pages Add user docs for Pages access control 2018-11-21 00:49:51 +00:00
raketasks Add gitlab:gitaly:check task for Gitaly health check 2018-10-23 20:11:10 -03:00
troubleshooting Resolve Markdown ordered lists not conforming to styleguide 2018-11-13 10:53:38 +10:00
build_artifacts.md
compliance.md Add initial Compliance doc based on features.yml Compliance features 2018-08-31 08:53:12 +00:00
container_registry.md Emphasis the importance of auth registry 2018-11-07 11:24:20 +01:00
custom_hooks.md Symlinked hooks aren't executed 2018-11-09 09:33:56 +01:00
environment_variables.md Document that GITLAB_CDN_HOST takes an base URL 2018-02-04 13:39:41 +01:00
external_database.md Correct grammar (setup to set-up) in Docs 2018-09-21 16:29:14 +02:00
git_protocol.md Add information on support for git v2 in docs 2018-11-16 15:08:43 +00:00
housekeeping.md
incoming_email.md Docs: Incoming e-mails: require gitlab-ctl restart 2018-03-06 23:16:03 +00:00
index.md Add Git protocol v2 docs 2018-10-17 11:52:10 +00:00
issue_closing_pattern.md Fix closing issue default pattern 2018-09-06 16:00:12 +02:00
job_artifacts.md Docs: Fixing some bad links 2018-10-14 22:55:12 +00:00
job_traces.md Resolve "CE documentation is not CommonMark compliant" 2018-09-06 16:52:18 +00:00
logs.md Use JSON logging for helm install services 2018-11-27 15:23:02 +01:00
operations.md add index for doc/administration/operations/ 2017-12-11 14:05:08 -02:00
plugins.md Fix typos 2018-04-13 17:41:02 +00:00
polling.md
reply_by_email.md Correct grammar (setup to set-up) in Docs 2018-09-21 16:29:14 +02:00
reply_by_email_postfix_setup.md Resolve Markdown ordered lists not conforming to styleguide 2018-11-13 10:53:38 +10:00
repository_checks.md repository check doc: fix a broken link 2018-10-18 10:03:38 +02:00
repository_storage_paths.md Remove Git circuit breaker 2018-10-10 09:08:18 +02:00
repository_storage_types.md Allow public forks to be deduplicated 2018-12-07 19:18:37 +01:00
repository_storages.md
restart_gitlab.md
uploads.md Fix object storage tier information 2018-11-15 12:46:08 -05:00