Commit e2eb0f8b authored by James Ramsay's avatar James Ramsay

Enable repository object pools by default

Object pools allow Git objects to be shared from the parent project to forks,
reducing storage requirements.
parent 7301cd14
...@@ -2144,7 +2144,7 @@ class Project < ApplicationRecord ...@@ -2144,7 +2144,7 @@ class Project < ApplicationRecord
public? && public? &&
repository_exists? && repository_exists? &&
Gitlab::CurrentSettings.hashed_storage_enabled && Gitlab::CurrentSettings.hashed_storage_enabled &&
Feature.enabled?(:object_pools, self) Feature.enabled?(:object_pools, self, default_enabled: true)
end end
def leave_pool_repository def leave_pool_repository
......
---
title: Enable Git object pools
merge_request: 29595
author: jramsay
type: changed
...@@ -80,25 +80,20 @@ by another folder with the next 2 characters. They are both stored in a special ...@@ -80,25 +80,20 @@ by another folder with the next 2 characters. They are both stored in a special
### Hashed object pools ### Hashed object pools
CAUTION: **Beta:** > [Introduced](https://gitlab.com/gitlab-org/gitaly/issues/1606) in GitLab 12.1.
Hashed objects pools are considered beta, and are not ready for production use.
Follow [gitaly#1548](https://gitlab.com/gitlab-org/gitaly/issues/1548) for
updates.
For deduplication of public forks and their parent repository, objects are pooled Forks of public projects are deduplicated by creating a third repository, the object pool, containing the objects from the source project. Using `objects/info/alternates`, the source project and forks use the object pool for shared objects. Objects are moved from the source project to the object pool when housekeeping is run on the source project.
in an object pool. These object pools are a third repository where shared objects
are stored.
```ruby ```ruby
# object pool paths # object pool paths
"@pools/#{hash[0..1]}/#{hash[2..3]}/#{hash}.git" "@pools/#{hash[0..1]}/#{hash[2..3]}/#{hash}.git"
``` ```
The object pool feature is behind the `object_pools` feature flag, and can be Object pools can be disabled using the `object_pools` feature flag, and can be
enabled for individual projects by executing disabled for individual projects by executing
`Feature.enable(:object_pools, Project.find(<id>))`. Note that the project has to `Feature.disable(:object_pools, Project.find(<id>))`. Disabling object pools
be on hashed storage, should not be a fork itself, and hashed storage should be will not change existing deduplicated forks, but will prevent new forks from
enabled for all new projects. being deduplicated.
DANGER: **Danger:** DANGER: **Danger:**
Do not run `git prune` or `git gc` in pool repositories! This can Do not run `git prune` or `git gc` in pool repositories! This can
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment