Commit graph

17 commits

Author SHA1 Message Date
Lin Jen-Shin
5f811894a8 Remove unwanted refs after importing a project
Because we don't need them, and they would slow down
the repository, keeping unneeded objects as well.

We could also consider doing this in regular housekeeping.
2017-08-23 20:25:44 +08:00
Kim "BKC" Carlbäcker
be28f9520e Raise GC Lease Timeout to 24h
[ci skip]
2017-08-22 16:35:22 +02:00
Jacob Vosmaer
6bcc52a536 Refine Git garbage collection 2016-11-04 14:30:11 +01:00
Yorick Peterse
4e87c02313
Move pushes_since_gc to Redis
This moves tracking of the pushes since the last Git GC from PostgreSQL
to Redis. This reduces the number of writes on the "projects" table.
This in turn reduces the vacuuming overhead.

The lease used for incrementing the counter has been removed. This lease
was mostly put in place to prevent high database load but this isn't
needed anymore due to the counter now being stored in Redis.

Fixes gitlab-org/gitlab-ce#22125
2016-09-13 22:27:51 +02:00
Paco Guzman
0736397e08 Reset project pushes_since_gc when we enqueue the git gc call 2016-07-12 15:54:05 +02:00
Stan Hu
3dc6bf2b71 Expire the branch cache after git gc runs
Due to a stale NFS cache, it's possible that a branch lookup fails
while `git gc` is running and causes missing branches in merge requests.

Possible workaround for #15392
2016-07-12 05:42:19 -07:00
Paco Guzman
d91c6c0738 Throttle the update of project.pushes_since_gc to 1 minute 2016-07-05 10:09:47 +02:00
Alejandro Rodríguez
86359ec854 Refactor repository paths handling to allow multiple git mount points 2016-06-29 22:30:31 -04:00
Grzegorz Bizon
a55e8f109f Enable Style/NegatedIf Rubocop cop
Favor `unless` over `if` for negative conditions
(or control flow ||).

See #17478
2016-05-30 13:53:25 +02:00
Yorick Peterse
3b9edce803
Instrument the HousekeepingService class
This allows us to track how much time is spent in updating the
"pushes_since_gc" column as well as the time needed to obtain the lease.
2016-04-13 15:31:13 +02:00
Jacob Vosmaer
2057bc02a3 Do not retry "git gc" 2016-03-17 11:02:11 +01:00
Jacob Vosmaer
30b36c92c3 Use an exception to pass messages 2016-03-15 11:03:43 +01:00
Jacob Vosmaer
021d53c96d Run 'git gc' every 10 pushes 2016-03-14 16:49:24 +01:00
Jacob Vosmaer
a02fe251df Allow project housekeeping only once an hour 2016-03-14 15:55:45 +01:00
Jeroen Nijhof
d4690af8bc Use GitlabShellWorker.perform_async for housekeeping 2015-11-19 16:04:07 +01:00
Jeroen Nijhof
839aae0e47 Added housekeeping status and moved path check to gitlab-shell 2015-11-19 15:16:54 +01:00
Jeroen Nijhof
4f0a38f1a8 Added housekeeping for git repositories 2015-10-21 15:15:54 +02:00