6755 Commits

Author SHA1 Message Date
Matthew Oliver
a07f7dc8c0 Fix sporadic failure in TestAccountController unit test
The proxy server on occasion has error limited a node by the time the
test runs, causing the proxie's node_iter failing to iter out this
error limited  node. As the test uses a default FakeRing with no
extra handoffs, on this occasion we only get 2 requests which is not
enough for quorum, causing it to return a 503.

This patch sets the error_suppression_interval to 0 when creating
the proxy server. Meaning a node effectively isn't error_limited.

Change-Id: I96cf4c4d63594f803cc1cd57e874d1624db8e249
Closes-Bug: #1682026
2017-04-27 01:03:29 +00:00
Tim Burke
20072570d9 Fix sporadic failure in test/unit/obj/test_server.py
In particular, in TestObjectController.test_object_delete_at_async_update

Rarely (<0.1% of the time?), it would fail with:

======================================================================
FAIL: test_object_delete_at_async_update
(test.unit.obj.test_server.TestObjectController)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/vagrant/swift/test/unit/obj/test_server.py", line 4826, in
test_object_delete_at_async_update
    resp = req.get_response(self.object_controller)
  File "/usr/lib/python2.7/contextlib.py", line 24, in __exit__
    self.gen.next()
  File "/vagrant/swift/test/unit/__init__.py", line 1075, in
mocked_http_conn
    raise AssertionError('left over status %r' % left_over_status)
AssertionError: left over status [500, 500]
-------------------- >> begin captured stdout << ---------------------
test INFO: None - - [26/Apr/2017:22:32:13 +0000] "PUT /sda1/p/a/c/o" 400
19 "-" "-" "-" 0.0003 "-" 23801 0

--------------------- >> end captured stdout << ----------------------
>>  raise AssertionError('left over status %r' % [500, 500])

----------------------------------------------------------------------

Related-Bug: 1514111
Change-Id: I1af4a291fb67cf4b1829f167998a08644117a800
2017-04-26 15:51:16 -07:00
Jenkins
408500320b Merge "authors/changelog for 2.14.0" 2017-04-26 21:31:14 +00:00
Jenkins
20f7e5f857 Merge "Improve test_get_valid_utf8_str coverage" 2017-04-26 20:09:04 +00:00
John Dickinson
29e2edf8de authors/changelog for 2.14.0
Change-Id: I0a6a8e4d62d2181e6d959437d6e84eeb2c29a05d
2017-04-26 11:46:18 -07:00
Jenkins
1f540de0f1 Merge "Update version in controller-install-rdo" 2017-04-26 14:38:48 +00:00
Jenkins
d15ed269c2 Merge "Update version from Newton to Ocata" 2017-04-26 11:10:38 +00:00
Romain LE DISEZ
38d35797df Fix SSYNC failing to replicate unexpired object
Fix a situation where SSYNC would fail to replicate a valid object because
the datafile contains an expired X-Delete-At information while a metafile
contains no X-Delete-At information. Example:
 - 1454619054.02968.data => contains X-Delete-At: 1454619654
 - 1454619056.04876.meta => does not contain X-Delete-At info

In this situation, the replicator tries to PUT the datafile, and then
to POST the metadata. Previously, if the receiver has the datafile but
current time is greater than the X-Delete-At, then it considers it to
be expired and requests no updates from the sender, so the metafile is
never synced. If the receiver does not have the datafile then it does
request updates from the sender, but the ssync PUT subrequest is
refused if the current time is greater than the X-Delete-At (the
object is expired). If the datafile is transfered, the ssync POST
subrequest fails because the object does not exist (expired).

This commit allows PUT and POST to works so that the object can be
replicated, by enabling the receiver object server to open expired
diskfiles when handling replication requests.

Closes-Bug: #1683689
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: I919994ead2b20dbb6c5671c208823e8b7f513715
2017-04-26 11:29:40 +01:00
Jenkins
a852397578 Merge "Make add_dev complain louder about missing keys" 2017-04-26 07:14:22 +00:00
Clay Gerrard
6be5196fbe Make add_dev complain louder about missing keys
... and remove some cruft that couldn't possibly work

Change-Id: I560f0a29f0a881c63ec3cb910dbf5476fe2a915a
Related-Change-Id: I0d8928b55020592f8e75321d1f7678688301d797
2017-04-25 19:29:57 -07:00
lijunbo
a480f6c5f0 Update version from Newton to Ocata
Update version from newton to ocata in following files
 install-guide/controller-install-rdo.rst
 install-guide/source/controller-install-ubuntu.rst.

Change-Id: Ia0108e27d3498d3d6b546e6721e087db66eba4b0
2017-04-25 14:03:35 +00:00
Jenkins
da9cd16609 Merge "Update version in controller-install-ubuntu" 2017-04-25 09:54:10 +00:00
Jenkins
965ad372d5 Merge "Update version in controller-install-debian" 2017-04-25 09:54:02 +00:00
Jenkins
daa79e7de3 Merge "Update reno for stable/ocata" 2017-04-25 09:24:02 +00:00
Ondřej Nový
9e15effb3b Fix unit tests on i386 and other archs
Change-Id: I4f84b725e220e28919570fd7f296b63b34d0375d
2017-04-24 21:40:31 +00:00
Jenkins
bc92423150 Merge "Update version in finalize-installation-ubuntu" 2017-04-24 12:31:06 +00:00
Jenkins
aade2f9ff0 Merge "Update version in finalize-installation-rdo" 2017-04-24 12:29:10 +00:00
Tim Burke
1776e0fd20 Improve test_get_valid_utf8_str coverage
Include a couple trivial cases, and verify that surrogate pairs get
collapsed.

Also, move it to a more-appropriate class.

Related-Change: I4c570c08c770636d57b1157e19d5b7034fd9ed4e (patchset 3)
Change-Id: Iab0fdafe08d06a9d677dc421e60779e94d27ba9b
2017-04-20 15:54:54 -07:00
Jenkins
b2a22c1097 Merge "Remove redundant assignments of self._datadir" 2017-04-20 11:10:31 +00:00
Jenkins
f76c4ebf67 Merge "Update swift version in storage-install-ubuntu." 2017-04-20 10:43:21 +00:00
Jenkins
d51e36db5a Merge "Update swift version in storage-install-rdo.rst." 2017-04-20 10:39:09 +00:00
Jenkins
39cd9f9302 Merge "Add license in swift/common/ring" 2017-04-19 20:29:32 +00:00
Jenkins
cce5482bd8 Merge "Fix encoding issue in ssync_sender.send_put()" 2017-04-19 19:37:38 +00:00
Jenkins
939fa382fa Merge "Fix UnicodeDecodeError in reconstructor _full_path function" 2017-04-19 17:58:40 +00:00
Jenkins
a3cfeb7508 Merge "Update SUSE distro information in install guide" 2017-04-19 17:58:32 +00:00
Jenkins
88bca22549 Merge "Follow up tests for get_hashes regression" 2017-04-19 17:32:54 +00:00
Romain LE DISEZ
091157fc7f Fix encoding issue in ssync_sender.send_put()
EC object metadata can currently have a mixture of bytestrings and
unicode.  The ssync_sender.send_put() method raises an
UnicodeDecodeError when it attempts to concatenate the metadata
values, if any bytestring has non-ascii characters.

The root cause of this issue is that the object server uses unicode
for the keys of some object metadata items that are received in the
footer of an EC PUT request, whereas all other object metadata keys
and values are persisted as bytestrings.

This patch fixes the bug by changing diskfile write_metadata()
function to encode all unicode metadata keys and values as utf8
encoded bytes before writing to disk. To cope with existing objects
that have a mixture of unicode and bytestring metadata, the diskfile
read_metadata() function is also changed so that all returned unicode
metadata keys and values are utf8 encoded. This ensures that
ssync_sender.send_put() (and any other caller of diskfile
read_metadata) only reads bytestrings from object metadata.

Closes-Bug: #1678018
Co-Authored-By: Alistair Coles <alistairncoles@gmail.com>
Change-Id: Ic23c55754ee142f6f5388dcda592a3afc9845c39
2017-04-19 18:05:52 +01:00
Clay Gerrard
b41f47f0e0 Follow up tests for get_hashes regression
IMHO we shouldn't ever trust the invalidations file so much we try to
skip a listdir when creating a hashes.pkl for the first time.  There may
be some subtle races looking back on the related patch, and it's related
patches.

This just makes some assertions to help demonstrate we should maintain
the invariant of setting hashes to valid via listdir.

Change-Id: I767e34a405de7911e9596e038e58a9a29f57a8f8
Related-Change-Id: I08c8cf09282f737103e580c1f57923b399abe58c
2017-04-19 12:03:15 +01:00
Alistair Coles
c740447de5 Move EC-specific unit test to EC Test class
The refactoring in the Related-Change separated EC
specific object controller tests into EC specific TestCase
classes, but left two EC specific tests in the Replication
object controller test class. This patch moves them to the
appropriate test class.

Previously the tests were only executed once, now they are
executed in each of two subclasses using different EC
policies. As a result it was necessary to make the test
container name unique to the policy under test.

Related-Change: Ifd3d0fa66773e640bb61cc528f7a1b2358e97d91

Change-Id: Ie712ea91b5dd74c504a0dd6aa40c3d657277108c
2017-04-19 10:39:43 +01:00
Kota Tsuyuzaki
381640cf90 Fix (un)patch_policies
Due to the refactoring of TestObjectController (related-change),
all of BaseTestECObjectController test methods are not being
needed to be unpatched because they are expected to run for test
setup-ed policies.

This patch works for items as follows:

- Move part of setUp/tearDown routines at BaseTestObjectController
  needed by only TestReplicatedObjectController which affects
  patch_policies

- Remove all unpatch_policies from BaseTestECObjectController

- Set up self.ec_policy to avoid to set policy index and
  retrieve the policy for each test method.

The reason why I didn't squash this up to the related parent patch is
to clarify what was changed at those patches. The parent is for just
clustering the tests for each test class and this one attempts to
improve.

Related-Change: Idd155401982a2c48110c30b480966a863f6bd305
Change-Id: I25a3f8fc837706d78dca226fe282d9e5ead65a0d
2017-04-18 23:30:39 -07:00
Pete Zaitcev
702c24d3b2 Remove redundant assignments of self._datadir
This is harmless, but honestly annoying. Introduced by the big
ssync change If003dcc6f4109e2d2a42f4873a0779110fff16d6 .

Change-Id: I1a7c0171e03b900ca75da39b152cdffe60abe135
2017-04-18 15:51:14 -06:00
Alistair Coles
83750cf79c Fix UnicodeDecodeError in reconstructor _full_path function
Object paths can have non-ascii characters. Device dicts will
have unicode values. Forming a string using both will cause the
object path to be coerced to UTF8, which currently causes a
UnicodeDecodeError. This causes _get_response() to not return
and the recosntructor hangs.

The call to _full_path() is moved outside of _get_response()
(where its result is used in the exception handler logging)
so that _get_response() will always return even if _full_path()
raises an exception.

Unit tests are refactored to split out a new class with those
tests using an object name and the _full_path method, so that
the class can be subclassed to use an object name with non-ascii
characters.

Existing probe tests are subclassed to repeat using non-ascii
chars in object paths.

Change-Id: I4c570c08c770636d57b1157e19d5b7034fd9ed4e
Closes-Bug: 1679175
2017-04-18 14:07:01 +01:00
lijunbo
b2a3fab17e Add license in swift/common/ring
Source code should be licensed under the Apache 2.0 license.
Add Apache License in swift/common/ring/__init__.py file.

[H102 H103]:https://docs.openstack.org/developer/hacking/

Change-Id: Ic0fb19e50220c6c91d338759f4eeb786de6084ec
2017-04-18 12:14:01 +00:00
Jenkins
9627bcbc94 Merge "Fixed get ring name from recon cli" 2017-04-18 10:25:59 +00:00
Colleen Murphy
758dad819e Update SUSE distro information in install guide
SUSE tests their OpenStack packages on openSUSE Leap 42.2 and SLES 12
SP2, so this patch updates the install guide to address those newer
releases.

Change-Id: Ice6e85fdc8ac77029fde205dd9c63d3b62de3137
2017-04-18 09:39:08 +02:00
Jenkins
ae3080b768 Merge "TestObjectController refactoring" 2017-04-18 01:44:33 +00:00
shaofeng_cheng
ba52db86eb Update swift version in storage-install-ubuntu.
Update swift version newton to ocata in storage-install-ubuntu-debian.rst.

Change-Id: I21748742f431f6a9d11eecc3f6a3ee5458ca56b1
2017-04-14 10:25:57 +08:00
shaofeng_cheng
ab5a69998d Update swift version in storage-install-rdo.rst.
Update swift version newton to ocata in storage-install-rdo.rst.

Change-Id: Idd2072e921d7354e8c753c73ebe27633c3531805
2017-04-14 10:23:45 +08:00
shaofeng_cheng
feedf50102 Update version in finalize-installation-ubuntu
Update swift version newton to ocata in finalize-installation-ubuntu-debian.rst

Change-Id: If8a445077cbd5956e8506262a2046d0c93c5bd76
2017-04-14 10:19:25 +08:00
shaofeng_cheng
928fc369ef Update version in controller-install-rdo
Update version newton to ocata in controller-install-rdo.rst.

Change-Id: I741298e09c41ca2d981871bd4ee3b1d974a87396
2017-04-14 10:12:49 +08:00
shaofeng_cheng
a27b2915c7 Update version in controller-install-ubuntu
Update version newton to ocata in controller-install-ubuntu.rst.

Change-Id: I2e656a4158763307078714be79630e0c8882dba3
2017-04-14 10:10:14 +08:00
shaofeng_cheng
e3420e1728 Update version in controller-install-debian
Update version newton to ocata in controller-install-debian.

Change-Id: Ia3ab4a70f47c43238404d0312a0d5f4303333ff7
2017-04-14 10:09:01 +08:00
shaofeng_cheng
7d7cbefc97 Update version in finalize-installation-rdo
Update version newton to ocata in finalize-installation-rdo.rst.

Change-Id: I172528da6e9dfb9e386743df6cfb60f26db3dd54
2017-04-14 10:04:32 +08:00
lijunbo
6788bf4aad Fixed get ring name from recon cli
This patch uses a more specific string to match
the ring name in recon cli.

Almost all the places in the project where need to get the
suffix (like ring.gz, ts, data and .etc) will include the '.'
in front, if a file named 'object.sring.gz' in the swift_dir
will be added in the ring_names, which is not what we want.

Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>
Closes-Bug: #1680704
Change-Id: Ida659fa71585f9b0cf36da75b58b28e6a25533df
2017-04-13 07:01:03 +00:00
d633e9df59 Update reno for stable/ocata
Change-Id: Ibb4610747e8ad896b0d4b970094beb12c495e013
2017-04-11 21:57:57 +00:00
Pavel Kvasnička
bcd0eb70af Container drive error results double space usage on rest drives
When drive with container or account database is unmounted
replicator pushes database to handoff location. But this
handoff location finds replica with unmounted drive and
pushes database to the *next* handoff until all handoffs has
a replica - all container/account servers has replicas of
all unmounted drives.

This patch solves:
- Consumption of iterator on handoff location that results in
  replication to the next and next handoff.
- StopIteration exception stopped not finished loop over
  available handoffs if no more nodes exists for db replication
  candidency.

Regression was introduced in 2.4.0 with rsync compression.

Co-Author: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>

Change-Id: I344f9daaa038c6946be11e1cf8c4ef104a09e68b
Closes-Bug: 1675500
2017-04-11 09:49:59 +02:00
Jenkins
6bd24bf972 Merge "Optimize the link address" 2017-04-10 22:51:56 +00:00
Jenkins
a22208043f Merge "Modify _get_hashes() arguments to be more generic" 2017-04-10 22:50:11 +00:00
M V P Nitesh
71516ae990 Optimize the link address
Use https instead of http to ensure the safety

Change-Id: Ifdce2d0fde8ccd758cf3290cdf82faef244c8004
2017-04-10 15:23:05 +05:30
Jenkins
b3e69acb43 Merge "Fix race when consolidating new partition" 2017-04-08 00:55:23 +00:00