Commit 8ff5f6af authored by Achilleas Pipinellis's avatar Achilleas Pipinellis

Merge branch 'docs-manual-housekeeping-user' into 'master'

Warn against using plain git commands for housekeeping

See merge request gitlab-org/gitlab!69752
parents a4d03f31 98374035
......@@ -62,6 +62,12 @@ Housekeeping also [removes unreferenced LFS files](../raketasks/cleanup.md#remov
from your project on the same schedule as the `git gc` operation, freeing up storage space for your
project.
WARNING:
Running `git gc` or `git repack` commands manually in the
[repository folder](repository_storage_types.md#from-project-name-to-hashed-path)
is discouraged. If the created pack files get incorrect access rights (that is, owned by the wrong user)
browsing to the project page might result in `404` and `503` errors.
## How housekeeping handles pool repositories
Housekeeping for pool repositories is handled differently from standard repositories. It is
......@@ -76,7 +82,7 @@ This is the current call stack by which it is invoked:
1. `ObjectPoolService#fetch`
1. `Gitaly::FetchIntoObjectPoolRequest`
To manually invoke it from a Rails console if needed, you can call
To manually invoke it from a [Rails console](operations/rails_console.md) if needed, you can call
`project.pool_repository.object_pool.fetch`. This is a potentially long-running task, though Gitaly
times out in about 8 hours.
......
......@@ -204,12 +204,20 @@ See [LDAP Rake Tasks - LDAP Check](ldap.md#check) for details.
The following are solutions to problems you might discover using the Rake tasks documented
above.
### Dangling commits
### Dangling objects
`gitlab:git:fsck` can find dangling commits. To fix them, try
[enabling housekeeping](../housekeeping.md).
The `gitlab:git:fsck` task can find dangling objects such as:
If the issue persists, try triggering `gc` via the
```plaintext
dangling blob a12...
dangling commit b34...
dangling tag c56...
dangling tree d78...
```
To delete them, try [running housekeeping](../housekeeping.md).
If the issue persists, try triggering garbage collection via the
[Rails Console](../operations/rails_console.md#starting-a-rails-console-session):
```ruby
......@@ -217,6 +225,13 @@ p = Project.find_by_path("project-name")
Repositories::HousekeepingService.new(p, :gc).execute
```
If the dangling objects are younger than the 2 weeks default grace period,
and you don't want to wait until they expire automatically, run:
```ruby
Repositories::HousekeepingService.new(p, :prune).execute
```
### Delete references to missing remote uploads
`gitlab-rake gitlab:uploads:check VERBOSE=1` detects remote objects that do not exist because they were
......
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