By default install it is showing up as:
def _resize_on_write(self, image, image_size, bytes_written, chunk_length):
"""Handle the rbd resize when needed."""
if image_size != 0 or self.size >= bytes_written + chunk_length:
return self.size
new_size = self.size + self.resize_amount LOG.debug("resizing image to %s KiB" % (new_size / units.Ki)) image.resize(new_size)
# Note(jokke): We double how much we grow the image each time
# up to 8gigs to avoid resizing for each write on bigger images self.resize_amount = min(self.resize_amount * 2, 8 * units.Gi)
return new_size
Where it should be:
def _resize_on_write(self, image, image_size, bytes_written, chunk_length):
"""Handle the rbd resize when needed."""
if image_size != 0 or self.size >= bytes_written + chunk_length:
return self.size
self.resize_amount = min(self.resize_amount * 2, 8 * units.Gi)
# Note(jokke): We double how much we grow the image each time
# up to 8gigs to avoid resizing for each write on bigger images
new_size = self.size + self.resize_amount
LOG.debug("resizing image to %s KiB" % (new_size / units.Ki))
image.resize(new_size)
return new_size
The fix works for me too, and Antelope appears to have the fix in it, though the order of the code is not what is listed in https:/ /review. opendev. org/c/openstack /glance_ store/+ /885581 and causes the fix not to work.
By default install it is showing up as: on_write( self, image, image_size, bytes_written, chunk_length):
LOG.debug( "resizing image to %s KiB" % (new_size / units.Ki))
image. resize( new_size)
self.resize_ amount = min(self. resize_ amount * 2, 8 * units.Gi)
def _resize_
"""Handle the rbd resize when needed."""
if image_size != 0 or self.size >= bytes_written + chunk_length:
return self.size
new_size = self.size + self.resize_amount
# Note(jokke): We double how much we grow the image each time
# up to 8gigs to avoid resizing for each write on bigger images
return new_size
Where it should be:
def _resize_ on_write( self, image, image_size, bytes_written, chunk_length): resize_ amount = min(self. resize_ amount * 2, 8 * units.Gi) debug(" resizing image to %s KiB" % (new_size / units.Ki)) resize( new_size)
"""Handle the rbd resize when needed."""
if image_size != 0 or self.size >= bytes_written + chunk_length:
return self.size
self.
# Note(jokke): We double how much we grow the image each time
# up to 8gigs to avoid resizing for each write on bigger images
new_size = self.size + self.resize_amount
LOG.
image.
return new_size
The order appears to be wrong, self.resize_amount is in the wrong position during install, but in the right oder in https:/ /review. opendev. org/c/openstack /glance_ store/+ /885581