Repository navigation
Closed
Description
Our test deployment always seems to run out of disk space eventually. I hopped on the VM and found this:
web/0b5af54a-50b5-4e9f-a888-7f0a1bbbe6b1:~$ fly -t tf vs -d | awk '{print $2, $3, $4}' | sort | uniq -c | sort -n | grep '^ *[0-9]\{2,\}'
189 58b964cb-6ce5-4dfb-9f69-b1e122fbdea8 resource-type name:time,version:210cd426fc36d50bcd005c8ca56cfdc4af87e7d5
362 58b964cb-6ce5-4dfb-9f69-b1e122fbdea8 resource-type name:docker-image,version:afd962224535c88f533e8afad0e99bcd26403261So, for the same worker (first guid), we have 362 volumes for the same version of the docker-image resource type.
Here are two database entries for identical volumes:
atc=# select * from volumes where handle = 'fe1cc117-ca16-44aa-464b-f471558526c4';
-[ RECORD 1 ]----------------+-------------------------------------
id | 52271
handle | fe1cc117-ca16-44aa-464b-f471558526c4
resource_version |
resource_hash |
worker_name | 58b964cb-6ce5-4dfb-9f69-b1e122fbdea8
original_volume_handle |
output_name |
path |
host_path_version |
replicated_from |
container_id |
team_id |
state | created
parent_id |
parent_state |
worker_base_resource_type_id | 89
worker_resource_cache_id |
worker_task_cache_id |
worker_resource_certs_id |
atc=# select * from volumes where handle = 'fef50fda-68a7-4381-7427-b004cf7a8b2a';
-[ RECORD 1 ]----------------+-------------------------------------
id | 58883
handle | fef50fda-68a7-4381-7427-b004cf7a8b2a
resource_version |
resource_hash |
worker_name | 58b964cb-6ce5-4dfb-9f69-b1e122fbdea8
original_volume_handle |
output_name |
path |
host_path_version |
replicated_from |
container_id |
team_id |
state | created
parent_id |
parent_state |
worker_base_resource_type_id | 89
worker_resource_cache_id |
worker_task_cache_id |
worker_resource_certs_id |
atc=#
These volumes are pretty global, and aren't even team-scoped, so it doesn't make sense to have more than one.
We should at least make this impossible by adding a UNIQUE constraint. Once we've done that, maybe we can figure out why so many are being created.
- Concourse version: v3.11.0, likely earlier versions too
- Deployment type (BOSH/Docker/binary): BOSH
- Infrastructure/IaaS: GCP
- Did this used to work? unclear
Reacted by Marco Molteni
Activity
kmacoskey commentedon May 10, 2018
I can see the same issue on Concourse v3.9.2 and v3.12.0 for
git,s3, anddocker-imageresource types. With larger deployments this amounts to many 1ks of volumes.xtremerui commentedon May 11, 2018
@vito Added partial unique constraint to
concoursre_testObserved massive failure on job
bosh-watsandbosh-watsjswhile it tried to clean up test teams, it failed by violating above constraint. DB log:Check
volumestableteam_idcolumn, noticed that the itsvolumes_team_id_fkeyis set toSet NullwhenOn delete. This explains why there were duplicate resource type volumes that is not scoped to any team. Sinceconcourse-testis the only deployment that keep getting UI tests(and we don't delete the deployment afterwards), its disk keeps growing until explode.I believe this issue would be noticed by users who runs create/delete team frequently.
xtremerui commentedon May 14, 2018
Couple solutions here:
volumestable where it belongs to that team andworker_base_resource_type_idis not null.worker_base_resource_type_idto null so it could be picked on option 4 below.destroying. The current logic:bump atc
jmelchio commentedon May 16, 2018
We ended up going with option 4 and updated the VolumeRepository query that finds the orphaned volumes to include the case where the team_id is nil and worker_base_resource_type_id is not nil.
mikemimik commentedon May 18, 2018
What version of concourse will this target and land in?
xtremerui commentedon May 22, 2018
@mikemimik should be in the next release