5419 Commits

Author SHA1 Message Date
Jenkins
30624a866a Merge "Fix proxy-server's support for chunked transferring in GET object" 2016-03-03 01:06:16 +00:00
Jenkins
d90dc2eb13 Merge "Add container quota functional test" 2016-03-02 23:11:50 +00:00
Jenkins
5fc3ad7b53 Merge "Fix time-shifting of objects PUT with container-sync" 2016-03-02 20:59:26 +00:00
Jenkins
48b5e8a13f Merge "Fix bug in mem_diskfile write_metadata method" 2016-03-02 20:41:20 +00:00
Jenkins
fad838a26e Merge "Add X-Delete-After and X-Delete-At functional test" 2016-03-02 18:49:18 +00:00
Takashi Kajinami
8e4347afd5 Fix proxy-server's support for chunked transferring in GET object
Proxy-server now requires Content-Length in the response header
when getting object and does not support chunked transferring with
"Transfer-Encoding: chunked"

This doesn't matter in normal swift, but prohibits us from putting
any middelwares to execute something like streaming processing of
objects, which can't calculate the length of their response body
before they start to send their response.

Change-Id: I60fc6c86338d734e39b7e5f1e48a2647995045ef
2016-03-02 22:56:13 +09:00
Jenkins
3927bf1f17 Merge "Add object replicator's succeeded and failed counts in log" 2016-03-01 16:22:49 +00:00
Jenkins
368423df3d Merge "Use uppercase 'S' in word "OpenStack"" 2016-03-01 16:21:41 +00:00
Hisashi Osanai
9c5b01e7c7 Add container quota functional test
This patch provides one container quota functional test.

Change-Id: I16354c15fc434d70f9bb6b9b1e18b09357195c83
2016-02-29 16:41:45 +00:00
Hisashi Osanai
efdc6ee8db Add X-Delete-After and X-Delete-At functional test
This patch provides functional tests for X-Delete-After and X-Delete-At.

Change-Id: I55b0d0584428413aa7a31f66defec55f9b1bbcd9
2016-02-29 11:51:07 +00:00
Takashi Kajinami
bd93d44bb4 Make sure all temp files get deleted in test_ringbuilder
This patch makes test_ringbuilder create a temporal directory,
run ring builder commands under it, and delete it after testing
for each test cases, to fix temp file leaking.

Change-Id: I6f59fe095ea6485af0e60b5a8e8fc3892e0a0f90
2016-02-29 18:21:46 +09:00
Jenkins
61928443ed Merge "Fix inconsistent suffix hashes after ssync of tombstone" 2016-02-26 23:37:44 +00:00
Jenkins
d8a5bf880f Merge "Fix StatsD tests to not use real DNS" 2016-02-26 21:39:40 +00:00
benjkeller
10b5765c60 Rename test_object_delete_at_aysnc
This renames test_object_delete_at_aysnc to
test_object_delete_at_async to match with the function
async_update which it tests.

Change-Id: I726afcbf08a3449c7af2834e573b97be378a86cd
Closes-Bug: 1550067
2016-02-25 18:57:53 -06:00
John Dickinson
9e53bb47ef updated some weird whitespace character to a normal one
Change-Id: I187fb8fc8d10f950bbebc586999eced0bc117432
2016-02-24 09:48:57 -08:00
Jenkins
090d7c9764 Merge "Add warn method back to LogAdapter" 2016-02-24 06:24:39 +00:00
Jenkins
dff21a803e Merge "fix formatting of bulk operations doc" 2016-02-24 03:30:49 +00:00
Jenkins
abd3e06300 Merge "Reduce code duplication" 2016-02-24 03:30:41 +00:00
Jenkins
885e219164 Merge "Mock sleep in direct_client retry tests" 2016-02-24 03:30:31 +00:00
Jenkins
f75e4f2d77 Merge "Add option for label to static web listings" 2016-02-24 03:30:07 +00:00
Jenkins
8f0ba56d0d Merge "Replace assertEqual(None, *) with assertIsNone in tests" 2016-02-24 03:29:59 +00:00
Jenkins
66e25d1eec Merge "Fix object-server to handle newer ts file" 2016-02-24 03:29:02 +00:00
Clay Gerrard
076134784b Add warn method back to LogAdapter
The change in 684c4c04 to improve py3 support breaks older middleware
that consumes the SwiftLogger.

Good for Swift code to not to use warn because it's deprecated.

Bad for LogAdapter to not faithfully provide the current python logging
module API (deprecated or otherwise).

Change-Id: Ib0baf66b7f33f91562867076ff0526a287d8e5a6
2016-02-23 17:45:13 -08:00
Samuel Merritt
eb7ca115e6 Fix StatsD tests to not use real DNS
In common/test_utils.py, TestStatsdLogging had the majority of its
test cases calling the real socket.getaddrinfo(), which uses real
DNS. This is very slightly slower than using a mock getaddrinfo() when
the machine running the tests has functioning DNS, but on a machine
with no network connection at all, the tests are excruciatingly slow
due to timeouts.

This commit mocks things out as appropriate. There's still one user of
the real getaddrinfo(), but it's for ::1, so that's just local
resolution based on /etc/hosts.

Timing numbers for "./.unittests test.unit.common.test_utils:TestStatsdLogging":

 * network, without this patch: 1.8s
 * no network, without this patch: 221.2s (ouch)
 * network, with this patch: 1.1s
 * no network, with this patch: 1.1s

Change-Id: I1a2d6f24fc9bb928894fb1fd8383516250e29e0c
2016-02-23 14:00:34 -08:00
Thiago da Silva
b97adf70ad fix formatting of bulk operations doc
Change-Id: I247d2867c55d6bbf2288dfb74271f57c6f88b243
2016-02-23 16:24:21 -05:00
Clay Gerrard
cfd5021235 dry out container unittests
Change Ifcc4392ffa4df485ce3c62a35d0fcc8c93de74aa introduced
TestContainerController4Replicas as a subclass of
TestContainerController. And there is duplicated code
block to override setUp method.

This patch removed the duplicated code block.

Change-Id: Iad0b64cba52554b89dbd959475a2ce7c0d9a20eb
2016-02-23 09:17:56 +00:00
Jenkins
d9f500a128 Merge "Make _get_addr() method a function in utils." 2016-02-22 20:30:22 +00:00
Jenkins
3e3ad5cb16 Merge "Fail early if the memcache address is invalid." 2016-02-22 19:42:20 +00:00
Jenkins
c4284f89f0 Merge "Use 201 insted of 200 in PUT test case" 2016-02-22 19:41:23 +00:00
Jenkins
01b07026c0 Merge "Changing the base version to python2.7 for pep8 checks" 2016-02-22 19:40:27 +00:00
Jenkins
bc34f79163 Merge "Add unit tests for checking responses in ContainerController" 2016-02-22 12:35:41 +00:00
Jenkins
d53210e1d6 Merge "functest for x-timestamp validation" 2016-02-22 10:22:11 +00:00
Takashi Kajinami
406e8996fb Use 201 insted of 200 in PUT test case
There are some unit test cases which assumes 200 as the response
of PUT request, but 200 is never returned in PUT.
This patch replaces 200 in PUT by 201, and adapt unit test cases
to real case.

Change-Id: I35fc7a4fe7fcc5558a9e6c6371105793c2710f3e
2016-02-22 16:10:09 +09:00
Hisashi Osanai
5b18455cef Add unit tests for checking responses in ContainerController
This patch provides unit tests to check responses for various situation
in three/four replicas env.

Change-Id: Ifcc4392ffa4df485ce3c62a35d0fcc8c93de74aa
2016-02-22 16:08:23 +09:00
Jenkins
99bc2a4a7d Merge "Fixed log format in object auditor" 2016-02-19 22:21:44 +00:00
Jenkins
b510442b15 Merge "Make write-only container access consistent" 2016-02-19 12:56:38 +00:00
Jenkins
9f2a7b1d2f Merge "Add unit tests for checking responses in AccountController" 2016-02-19 07:23:53 +00:00
Tim Burke
002513d217 Make write-only container access consistent
Previously, if a user could write to (but not read from) a container,
the behavior for object POST would vary depending on whether
object_post_as_copy was enabled (403 response) or disabled (202
response).

Now, POSTs will consistently be allowed, regardless of whether fast-POST
is enabled.

Change-Id: I1d6dcbc4f5034a322a1073850fc3b059ebb1c0fa
2016-02-18 15:45:15 -08:00
Ondřej Nový
9a6c6b5571 Fixed log format in object auditor
Change-Id: I218e08446c5ffda2db7c774ec8bb9d28ce9f63e7
2016-02-18 17:38:42 +01:00
Alistair Coles
2d55960a22 Fix inconsistent suffix hashes after ssync of tombstone
Consider two replicas of the same object whose ondisk files
have diverged due to failures:

  A has t2.ts
  B has t1.data, t4.meta

(The DELETE at t2 did not make it to B. The POST at t4 was
rejected by A.)

After ssync replication the two ondisk file sets will not be
consistent:

  A has t2.ts  (ssync cannot POST t4.meta to this node)
  B has t2.ts, t4.meta (ssync should not delete t4.meta,
                        there may be a t3.data somewhere)

Consequenty the two nodes will report different hashes for the
object's suffix, and replication will repeat, always with the
inconsistent outcome. This scenario is reproduced by the probe
test added in this patch.

(Note that rsync replication does result in (t2.ts, t4.meta)
on both nodes.)

The solution is to change the way that suffix hashes are
calculated. Currently the names of *all* files found in each
object dir are added to the hash.  With this patch the
timestamps of only those files that could be used to
construct a valid diskfile are added to the hash. File
extensions are appended to the timestamp so that in most
'normal' situations the result of the hashing is the same
as before this patch. That avoids a storm of hash mismatches
when this patch is deployed in an existing cluster.

In the problem case described above, t4.meta is no longer
added to the hash, since it is not useful for constructing
a diskfile. (Note that t4.meta is not deleted because it
may become useful should a t3.data be replicated in future).

Closes-Bug: 1534276
Change-Id: I99e88b8d5f5d9bc22b42112a99634ba942415e05
2016-02-18 15:45:10 +00:00
Jenkins
ebe61381c2 Merge "Keep the Usage of exit()/sys.exit() Consistent" 2016-02-18 14:26:49 +00:00
Kota Tsuyuzaki
ddeb0cde9f Fix object-server to handle newer ts file
Swift object-server will return 409 Conflict when the incomming
request X-Timestamp is older than the local disk file to prevent
wasted data transfer and disk space consumption. However, IFF,
the local disk file is a tombstone, current object-server will
write the data in the device and cleanup it according to timestamp
comparison result in hash_cleanup_list_dir, and then return 201
Created. That's wasted and far from the semantics in the normal case.

This patch fixes object-server to catch the DiskFileDeleted exception
at PUT request, and then, set the timestamp from tombstone as
original_timestamp to be able to compare with request timestamp.

Co-Authored-By: Kazuhiro Miyahara <miyahara.kazuhiro@lab.ntt.co.jp>
Change-Id: I078c9cb90707a3c320708e76ea42cbfa73e1ea4b
Closes-Bug: #1546865
2016-02-18 02:13:01 -08:00
Béla Vancsics
878688cae0 Reduce code duplication
Reduced source code by extracting duplicated code
(swift/common/direct_client.py)
http://openqa.sed.hu/dashboard/index/5?did=1

Change-Id: I47fa6ae12c646e8e42fb0a46a017971f05d883fc
Closes-Bug: 1536067
2016-02-18 09:59:56 +01:00
Kazuhiro MIYAHARA
c3201f256c Remove execute permissions from doc files and swift.conf-sample
Some doc files and swift.conf-sample were added execute permissions in past changes.
This patch remove execute permissions from them.

Change-Id: Id8844989a8321578e9207566ebd6660f5b9523f0
2016-02-18 08:52:03 +00:00
Jenkins
f73b7a5d64 Merge "Bump PyECLib requirement to >= 1.2.0" 2016-02-18 00:27:40 +00:00
Jenkins
8bec700e7b Merge "Add note on using printable chars for swift_hash_path_suffix/prefix" 2016-02-18 00:23:28 +00:00
Jenkins
6d6629f7b1 Merge "Added links to API reference and usage guides" 2016-02-17 22:03:58 +00:00
Christian Schwede
e46d6b1725 Add note on using printable chars for swift_hash_path_suffix/prefix
Using unprintable characters for swift_hash_path_prefix/suffix might lead to
hard problems when parsing of these values changes, for example due to newer
Python versions or changes in the parsers itself. Let's avoid this and add a
note that deployers should use printable strings for these values.

Change-Id: I976982b753b6af831ab91d7190f50f8f15bf73bf
2016-02-17 20:47:53 +01:00
Donagh McCabe
b8fa480808 Added links to API reference and usage guides
Added a link to the API reference (where headers and query
strings are documented; click the "detail" button to see).
Also added a reference to Swift section of the OpenStack end
user guide. This contains some additional details about the API.

No attempt was made to reconcile duplicate information. Instead
this patch links documents that might otherwise be overlooked.
However, I fixed text, originally in a table, that had become
garbled in a prior patch.

Change-Id: I0910cbeb0c8bffc00e510f35585603e7b7a67790
2016-02-17 18:39:22 +00:00
Jenkins
6a3b5f9aec Merge "Additional info log message for drive-audit" 2016-02-17 11:51:55 +00:00