`backup_keep_time` is only applied to backups of the current GitLab version but not older ones
Summary
backup_keep_time
is only applied to backups of the current GitLab version, leaving behind outdated and never cleaned backups of previous versions
Steps to reproduce
- run
/usr/bin/gitlab-rake gitlab:backup:create
- list the backups stored in your backup location (
gitlab_rails['backup_path']
) - update GitLab to a newer version
- reduce
backup_keep_time
to a very small timeframe and reconfigure gitlab (gitlab-ctl reconfigure
) - wait longer than
backup_keep_time
seconds - run
/usr/bin/gitlab-rake gitlab:backup:create
- list the backups stored in your backup location (
gitlab_rails['backup_path']
)
Backups created by the previous GitLab version(s) are not removed even though they are older than backup_keep_time
.
What is the current bug behavior?
/usr/bin/gitlab-rake gitlab:backup:create
removes backups which are older than backup_keep_time
seconds but only if they have been created by the same GitLab version. This leaves behind a growing number of outdated and unusable backups which uses more and more disk space
What is the expected correct behavior?
/usr/bin/gitlab-rake gitlab:backup:create
removes backups which are older than backup_keep_time
seconds irrespectively of the version of GitLab which has created it
Remark
There are perhaps use cases where this can make sense, but generally it doesn't, as the purpose of backup_keep_time
is to keep only a certain number of backups to save disk space. If the current behaviour should be preserved, then it could be made configurable (gitlab_rails['backup_keep_old_gitlab_versions']
?) but the default should be to apply backup_keep_time
to all present backups.
Relevant logs and/or screenshots
not available
Output of checks
not available
Results of GitLab environment info
Expand for output related to GitLab environment info
System information System: Debian 8.11 Current User: git Using RVM: no Ruby Version: 2.5.3p105 Gem Version: 2.7.6 Bundler Version:1.16.6 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.18.1 Sidekiq Version:5.2.3 Go Version: unknown
GitLab information Version: 11.7.5 Revision: c5b5b18 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: [XXX redacted XXX] HTTP Clone URL: [XXX redacted XXX] SSH Clone URL: [XXX redacted XXX] Using LDAP: yes Using Omniauth: yes Omniauth Providers:
GitLab Shell Version: 8.4.4 Repository storage paths:
- local: /var/opt/gitlab/git-data/repositories
- default: /data/gitlab/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git
Results of GitLab application Check
Expand for output related to the GitLab application check
Checking GitLab subtasks ...Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.4 ? ... OK (8.4.4) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: OK Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... local ... OK default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Reply by email is disabled in config/gitlab.yml
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) [XXX redacted XXX]
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... no Try fixing it: sudo chown -R git /data/var/opt/gitlab/gitlab-rails/uploads sudo find /data/var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /data/var/opt/gitlab/gitlab-rails/uploads -type d -not -path /data/var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 10/4 ... yes 5/5 ... yes 6/7 ... yes 49/8 ... yes 8/9 ... yes 50/10 ... yes 48/11 ... yes 23/13 ... yes 10/15 ... yes 23/16 ... yes 23/17 ... yes 10/18 ... yes 10/20 ... yes 10/22 ... yes 10/23 ... yes 10/24 ... yes 10/25 ... yes 10/27 ... yes 10/28 ... yes 10/29 ... yes 10/30 ... yes 10/31 ... yes 10/32 ... yes 10/33 ... yes 10/34 ... yes 10/35 ... yes 10/36 ... yes 10/37 ... yes 10/38 ... yes 10/39 ... yes 10/40 ... yes 10/41 ... yes 10/42 ... yes 10/43 ... yes 10/44 ... yes 10/45 ... yes 10/46 ... yes 10/47 ... yes 10/48 ... yes 10/49 ... yes 10/50 ... yes 10/51 ... yes 10/54 ... yes 10/55 ... yes 10/56 ... yes 10/57 ... yes 10/58 ... yes 10/59 ... yes 10/61 ... yes 34/63 ... yes 34/64 ... yes 34/65 ... yes 34/66 ... yes 34/67 ... yes 34/68 ... yes 34/69 ... yes 34/70 ... yes 48/71 ... yes 48/73 ... yes 48/74 ... yes 50/75 ... yes 48/76 ... yes 5/77 ... yes 7/80 ... yes 39/81 ... yes 41/82 ... yes 5/83 ... yes 43/84 ... yes 48/85 ... yes 43/88 ... yes 51/89 ... yes 10/90 ... yes 48/91 ... yes 48/92 ... yes 48/96 ... yes 10/97 ... yes 10/98 ... yes 53/100 ... yes 53/101 ... yes 53/102 ... yes 8/103 ... yes 48/104 ... yes 48/105 ... yes 5/106 ... yes 5/107 ... yes 50/108 ... yes 8/109 ... yes 48/110 ... yes 23/111 ... yes 50/112 ... yes 12/114 ... yes 48/116 ... yes 95/117 ... yes 34/119 ... yes 24/121 ... yes 59/124 ... yes 59/125 ... yes 63/126 ... yes 23/128 ... yes 48/129 ... yes 64/130 ... yes 63/131 ... yes 63/133 ... yes 58/136 ... yes 63/137 ... yes 58/138 ... yes 10/139 ... yes 58/140 ... yes 63/141 ... yes 67/142 ... yes 72/143 ... yes 63/144 ... yes 58/145 ... yes 52/148 ... yes 58/149 ... yes 48/150 ... yes 69/152 ... yes 69/153 ... yes 34/155 ... yes 48/157 ... yes 69/158 ... yes 75/159 ... yes 35/160 ... yes 10/161 ... yes 69/162 ... yes 34/163 ... yes 63/164 ... yes 10/165 ... yes 69/166 ... yes 33/167 ... yes 69/168 ... yes 69/169 ... yes 58/170 ... yes 10/171 ... yes 58/172 ... yes 23/173 ... yes 69/174 ... yes 34/175 ... yes 78/176 ... yes 78/177 ... yes 78/178 ... yes 63/179 ... yes 62/180 ... yes 58/181 ... yes 58/182 ... yes 95/183 ... yes 10/184 ... yes 10/185 ... yes 10/188 ... yes 5/189 ... yes 24/190 ... yes 48/191 ... yes 10/193 ... yes 24/194 ... yes 6/195 ... yes 92/196 ... yes 61/197 ... yes 10/198 ... yes 69/199 ... yes 69/200 ... yes 94/201 ... yes 93/202 ... yes 95/203 ... yes 95/204 ... yes 95/205 ... yes 90/206 ... yes 90/207 ... yes 97/208 ... yes 7/209 ... yes 95/211 ... yes 48/212 ... yes 12/214 ... yes 40/215 ... yes 90/216 ... yes 7/217 ... yes 99/219 ... yes 44/221 ... yes 6/222 ... yes 95/223 ... yes 48/224 ... yes 70/225 ... yes 103/226 ... yes 5/227 ... yes 6/228 ... yes 6/230 ... yes 104/231 ... yes 40/232 ... yes 65/233 ... yes 65/237 ... yes 65/238 ... yes 70/239 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.3.5 ? ... yes (2.5.3) Git version >= 2.18.0 ? ... yes (2.18.1) Git user has default SSH configuration? ... yes Active users: ... 69
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
Possible fixes
not available