Enable storage replication for V2 and add backfill tool

Fixes #1501
This commit is contained in:
Joseph Schorr 2016-05-31 16:43:49 -04:00
parent 1ddc73416c
commit 12924784ce
6 changed files with 93 additions and 12 deletions

View file

@ -180,7 +180,8 @@ def lookup_repo_storages_by_content_checksum(repo, checksums):
for counter, checksum in enumerate(set(checksums)):
query_alias = 'q{0}'.format(counter)
candidate_subq = (ImageStorage
.select(ImageStorage.id, ImageStorage.content_checksum, ImageStorage.image_size)
.select(ImageStorage.id, ImageStorage.content_checksum,
ImageStorage.image_size, ImageStorage.uuid)
.join(Image)
.where(Image.repository == repo, ImageStorage.content_checksum == checksum)
.limit(1)