summaryrefslogtreecommitdiff
path: root/doc/administration/raketasks/check.md
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-20 13:18:24 +0000
commit0653e08efd039a5905f3fa4f6e9cef9f5d2f799c (patch)
tree4dcc884cf6d81db44adae4aa99f8ec1233a41f55 /doc/administration/raketasks/check.md
parent744144d28e3e7fddc117924fef88de5d9674fe4c (diff)
downloadgitlab-ce-14.3.0-rc42.tar.gz
Add latest changes from gitlab-org/gitlab@14-3-stable-eev14.3.0-rc42
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