Comment 24 for bug 1916482

Revision history for this message
James Black (jblackosa) wrote (last edit ):

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:
    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 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