summaryrefslogtreecommitdiff
path: root/doc/administration/raketasks/check.md
diff options
context:
space:
mode:
Diffstat (limited to 'doc/administration/raketasks/check.md')
-rw-r--r--doc/administration/raketasks/check.md25
1 files changed, 20 insertions, 5 deletions
diff --git a/doc/administration/raketasks/check.md b/doc/administration/raketasks/check.md
index 56bf711f187..7cd7ecc26f7 100644
--- a/doc/administration/raketasks/check.md
+++ b/doc/administration/raketasks/check.md
@@ -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
@@ -271,7 +286,7 @@ To delete these references to missing local artifacts (`job.log` files):
```ruby
artifacts_deleted = 0
- ::Ci::JobArtifact.all.each do |artifact| ### Iterate artifacts
+ ::Ci::JobArtifact.find_each do |artifact| ### Iterate artifacts
# next if artifact.file.filename != "job.log" ### Uncomment if only `job.log` files' references are to be processed
next if artifact.file.exists? ### Skip if the file reference is valid
artifacts_deleted += 1