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 ...@@ -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 from your project on the same schedule as the `git gc` operation, freeing up storage space for your
project. 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 ## How housekeeping handles pool repositories
Housekeeping for pool repositories is handled differently from standard repositories. It is 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: ...@@ -76,7 +82,7 @@ This is the current call stack by which it is invoked:
1. `ObjectPoolService#fetch` 1. `ObjectPoolService#fetch`
1. `Gitaly::FetchIntoObjectPoolRequest` 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 `project.pool_repository.object_pool.fetch`. This is a potentially long-running task, though Gitaly
times out in about 8 hours. times out in about 8 hours.
......
...@@ -204,12 +204,20 @@ See [LDAP Rake Tasks - LDAP Check](ldap.md#check) for details. ...@@ -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 The following are solutions to problems you might discover using the Rake tasks documented
above. above.
### Dangling commits ### Dangling objects
`gitlab:git:fsck` can find dangling commits. To fix them, try The `gitlab:git:fsck` task can find dangling objects such as:
[enabling housekeeping](../housekeeping.md).
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): [Rails Console](../operations/rails_console.md#starting-a-rails-console-session):
```ruby ```ruby
...@@ -217,6 +225,13 @@ p = Project.find_by_path("project-name") ...@@ -217,6 +225,13 @@ p = Project.find_by_path("project-name")
Repositories::HousekeepingService.new(p, :gc).execute 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 ### Delete references to missing remote uploads
`gitlab-rake gitlab:uploads:check VERBOSE=1` detects remote objects that do not exist because they were `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