Merge pull request #1068 from coreos-inc/slowqueryfix
Remove check for derived image storages on image storage
This commit is contained in:
commit
5ac7369bf5
1 changed files with 1 additions and 4 deletions
|
@ -29,12 +29,9 @@ def garbage_collect_storage(storage_id_whitelist):
|
|||
return (select_base_query
|
||||
.switch(ImageStorage)
|
||||
.join(Image, JOIN_LEFT_OUTER)
|
||||
.switch(ImageStorage)
|
||||
.join(DerivedStorageForImage, JOIN_LEFT_OUTER,
|
||||
on=(ImageStorage.id == DerivedStorageForImage.derivative))
|
||||
.where(ImageStorage.id << list(candidates))
|
||||
.group_by(*group_by)
|
||||
.having((fn.Count(Image.id) == 0) & (fn.Count(DerivedStorageForImage.id) == 0)))
|
||||
.having(fn.Count(Image.id) == 0))
|
||||
|
||||
# Note: Both of these deletes must occur in the same transaction (unfortunately) because a
|
||||
# storage without any placement is invalid, and a placement cannot exist without a storage.
|
||||
|
|
Reference in a new issue