Comment 5 for bug 891738

Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to glance (master)

Reviewed: https://review.openstack.org/2072
Committed: http://github.com/openstack/glance/commit/98b1ef337ee63f239829b44aec4d05cea99f98ad
Submitter: Jenkins
Branch: master

 status fixcommitted
 done

commit 98b1ef337ee63f239829b44aec4d05cea99f98ad
Author: Paul Bourke <email address hidden>
Date: Mon Dec 5 15:56:18 2011 +0000

    Secondary iteration of fix for bug 891738

    A problem exists that images larger than large_object_size without a
    known image_size will fail to be segmented and hence fail to be added
    to swift.

    This patch alters the chunking process slightly:

    - Instead of reading min(large_object_chunk_size, bytes_left) from the
      stream, simply read large_object_chunk_size until we reach EOL(None).
      This works even when there is less than large_object_chunk_size bytes
      amount available.

    - The image_size can be determined from the combined length of each
      chunk read. If we are passed an unknown image_size this value can be
      used for the registry.

    Test Changes:

    - Fixed bug in fake_put_object which was highlighted by Jay when
      reviewing this changeset.
      The put of the manifest object needed to be moved inside the
      check for previous existence of a key.

    - Added test_add_large_object_zero_size to
      glance.tests.unit.test_swift_store:TestStore.

      This unit test demonstrates the bug and will test for regressions. It
      mirrors test_add_large_object but specifies an image_size of 0 to
      excercise the new code path.

    Change-Id: Ic8b78be5dce2281c80372ed446499f6d0bc07f40