2849 Commits

Author SHA1 Message Date
Samuel Merritt
99305b9300 Fix probe tests from commit cf48e75
Commit cf48e75 changed the default account/container/object ports in a
lot of places, including the probetests. However, it didn't change
them in doc/saio/bin/remakerings, and since the probe tests must match
the rings, they started failing.

This commit just backs out the changes to the test/probe directory so
that remakerings and the probe tests match again.

Change-Id: I316a09e6ee1a911f37ce9df3d641644739f88eeb
2016-05-02 17:29:32 -07:00
Shashirekha Gundur
cf48e75c25 change default ports for servers
Changing the recommended ports for Swift services
from ports 6000-6002 to unused ports 6200-6202;
so they do not conflict with X-Windows or other services.

Updated SAIO docs.

DocImpact
Closes-Bug: #1521339
Change-Id: Ie1c778b159792c8e259e2a54cb86051686ac9d18
2016-04-29 14:47:38 -04:00
Jenkins
ce6c850258 Merge "Fix versioned_writes functional test skipping" 2016-04-26 23:23:33 +00:00
Tim Burke
5e420efc72 Fix versioned_writes functional test skipping
Previously, if object versioning was enabled via the old-style
allow_versions container-server setting rather than the new-style
allow_versioned_writes proxy-server setting,
TestCrossPolicyObjectVersioning would skip tests while
TestObjectVersioning and TestObjectVersioningUTF8 would run them.

Additionally, if versioned_writes was explicitly included in the
proxy-server's pipeline and allow_versioned_writes was disabled,
the functional tests would fail with a 412.

Now, all three will use the same logic to check whether versioning is
enabled. Specifically, they will all try to set an X-Versions-Location
header and skip if it doesn't stick.

Additionally, the TestCrossPolicyObjectVersioningEnv will now properly
clean up after itself.

Change-Id: I4c788a0e18587ff17d3c6e346fd22b881495f06d
2016-04-26 21:37:09 +00:00
Denis V. Meltsaykin
1a18079a15 Change pids' type to set
Previously, the pids type was list(), which raised a ValueError in case if
pid was not in pids during the pids.remove(pid) call. The fix changes
the type of pids to set() and substitutes remove() with discard(), which
doesn't raise an Exception if a value is not in the set.

Change-Id: I8d41cb2a8ec14d29e5c7411ddfe48ae7a41deb45
Closes-Bug: #1567638
2016-04-23 18:14:02 +03:00
Jenkins
88b2159961 Merge "fix fallocate_reserve traceback" 2016-04-22 23:03:12 +00:00
Jenkins
60c127575b Merge "swift-[account|container]-info when disk is full" 2016-04-22 17:31:09 +00:00
Jenkins
72372c1464 Merge "decouple versioned writes from COPY" 2016-04-21 07:35:59 +00:00
Jenkins
760dcfd53d Merge "Require account/container metadata be UTF-8" 2016-04-20 19:30:22 +00:00
Jenkins
d6471c7019 Merge "Stop staticweb revealing container existence to unauth'd requests" 2016-04-19 02:00:28 +00:00
Jenkins
d57d29044b Merge "Per container stat. report" 2016-04-18 07:23:31 +00:00
Samuel Merritt
ca304cd08e Ignore negative suffix-byte-range requests.
If the client asked for "Range: bytes=--123", Swift would respond with
a 206 and a Content-Length of -123. Now that Range header is ignored
just like all kinds of other invalid Range headers.

Change-Id: I30d4522d223076ce342d20c52f57ff0eb2aea1f4
Closes-Bug: 1571106
2016-04-15 17:22:44 -07:00
Jenkins
badc0d1477 Merge "Adds eventlet monkey patching of select module if thread is pathed" 2016-04-15 21:07:41 +00:00
Jenkins
375d297aa9 Merge "Don't include conditional headers in SLO HEAD requests" 2016-04-15 20:57:41 +00:00
Dmitriy Ukhlov
746d928a87 Adds eventlet monkey patching of select module if thread is pathed
Oslo.messaging pika driver requires patching of select module if thread
is patched.
Pika driver uses select call and if it is not patched onsuming messages
blocks whole eventlet loop

Closes-Bug: #1570242
Change-Id: I9756737309f401ebddb7475eb84725f65bca01bf
2016-04-15 14:04:12 +00:00
Jenkins
346dad2904 Merge "Make rsync ignore it's own temporary files" 2016-04-14 20:02:19 +00:00
oshritf
c96d5c671d Per container stat. report
In addition to the container sync stat. report, keeping per container
statistics allows administrator with more control over bytes
transfered over a specific time per user account: The per container stats
are crucial for billing purposes and provides the operator a 'progress
bar' equivalent on the container's replication status.

Change-Id: Ia8abcdaf53e466e8d60a957c76e32c2b2c5dc3fa
2016-04-14 21:37:59 +03:00
Tim Burke
fb3692c9bb Don't include conditional headers in SLO HEAD requests
Previously, attempting to PUT a SLO manifest with `If-None-Match: *`
would include the header when validating the segments, causing the
upload to fail.

Now when SLO validates segments, no conditional headers will be
included in the HEAD request.

Change-Id: I03ad454092d3caa73d29e6d30d8033b45bc96136
Closes-Bug: #1569253
2016-04-13 21:56:10 -07:00
John Dickinson
91f980314f fix fallocate_reserve traceback
Previously, fallocate_reserve could result in a traceback. The
OSError being raised didn't have the proper errno set. This patch
sets the errno to ENOSPC.

Change-Id: I017b0584972ca8832f3b160bbcdff335ae9a1aa6
2016-04-13 11:57:45 -05:00
Jenkins
669dbd6411 Merge "Add unit tests for swift.account.reaper" 2016-04-12 11:04:18 +00:00
Jenkins
388a4edba6 Merge "Make DirectClientException report correct ip and port" 2016-04-12 10:37:07 +00:00
Jenkins
7c6b28348d Merge "Modified REPLICATE request to use replication_ip" 2016-04-12 10:29:31 +00:00
Thiago da Silva
b13a85367e decouple versioned writes from COPY
This change removes the use of the COPY request in the versioned
writes middleware. It changes the COPY verb for GETs and PUTs
requests. The main reasoning for this change is to remove any
dependency that versioning had on copy, which will allow for the COPY
functionality to be moved to middleware and to be to the left of the
versioned writes middleware in the proxy pipeline. In this way,
no COPY request will ever arrive at the versioned writes middleware.

A side benefit of this change is that it removes a HEAD request from
the PUT path. Instead of checking if a current version exists, a
GET request is sent, in case of success, a PUT is sent to the
versions container.

A unit test was removed that tested non-default storage policies.
This test is no longer necessary, since it was used to test
specific policy handling code in the COPY method in the proxy
object controller.

Closes-Bug: #1365862

Change-Id: Idf34fa8d04ff292df7134b6d4aa94ff40887b3a4
Co-Authored-By: Alistair Coles <alistair.coles@hp.com>
Co-Authored-By: Janie Richling <jrichli@us.ibm.com>
Co-Authored-By: Kota Tsuyuzaki <tsuyuzaki.kota@lab.ntt.co.jp>
Signed-off-by: Thiago da Silva <thiago@redhat.com>
2016-04-11 13:45:36 -04:00
Jenkins
4c7086375a Merge "Additionally break container servers during fast-post probes" 2016-04-11 08:52:19 +00:00
Jenkins
130767cd97 Merge "Refactor CORS unit tests" 2016-04-09 02:00:14 +00:00
Jenkins
284b935330 Merge "Assert that ChunkWriteTimouts are not raised" 2016-04-09 01:58:51 +00:00
Jenkins
ace3c0ace3 Merge "Fix infinite recursion during logging when syslog is down" 2016-04-07 22:13:20 +00:00
Alistair Coles
d09ef0da62 Assert that ChunkWriteTimouts are not raised
Follow up for change Ibbc89449e7878fc4215e47e3f7dfe4ae58a2d638
to add a test assertion that the ChunkWriteTimeout contexts are
exited without raising the timeout exception in
iter_bytes_from_response_part().

Change-Id: I6d323cb26779e457fb5940093a81b349b333a0af
2016-04-07 12:54:56 +01:00
Samuel Merritt
95efd3f903 Fix infinite recursion during logging when syslog is down
Change-Id: Ia9ecffc88ce43616977e141498e5ee404f2c29c4
2016-04-06 15:45:20 -07:00
Jenkins
475e448366 Merge "Shutdown backend EC connection contexts on disconnect" 2016-04-06 17:28:42 +00:00
Alistair Coles
5d56f40f04 Make DirectClientException report correct ip and port
When direct_client.direct_get_suffix_hashes raises a
DirectClientException the exception message and variables
should report the replication_ip and replication_port, as
opposed to the ip and port values reported for all other
case when the exception is raised.

Add option to override ip and port reported in
DirectClientException.

Also adds unit tests to verify both cases.

Related-Bug: 1566395
Change-Id: If3d952847c7199f4e9f6164858085367266386d2
2016-04-06 11:57:41 +01:00
Kota Tsuyuzaki
e15bceaa7e Refactor CORS unit tests
This is a follow-up patch for https://review.openstack.org/#/c/258392/
That one added good unit test cases for various kinds of
allowe_origin like '*' or ''(empty). However, the result of handling
in Swift proxy will depend on strict_cors_mode option configuration.

This patch refactors the unit tests to split out for
strict_cors_mode = on/off and add some missing unit tests for
each case.

Change-Id: I55f7cd279436b5c9f71d81fecf06021380e35579
2016-04-06 06:30:02 +00:00
Sivasathurappan Radhakrishnan
950b601a9c Modified REPLICATE request to use replication_ip
direct_client.direct_get_suffix_hashes doesn't use replication ip and
port for REPLICATE request. Since we have an option of doing
replication in separate network, we can add replication_ip and port
while creating rings if not it will get filled in with the regular
node's ip.

Change-Id: I34067df27042fc3146b795191ab8043ee1aed3ce
Closes-Bug:1566395
2016-04-05 22:45:17 +00:00
Jenkins
da6031067e Merge "Fix upgrade bug in versioned_writes" 2016-04-04 21:46:23 +00:00
Jenkins
f227072974 Merge "Correctly handle keys starting with the delimiter." 2016-04-01 02:02:44 +00:00
Tim Burke
ebf0b22012 Fix upgrade bug in versioned_writes
Previously, versioned_writes assumed that all container servers would
always have the latest Swift code, allowing them to return reversed
listings. This could cause the wrong version of a file to be restored
during rolling upgrades.

Now, versioned_writes will check that the listing returned is actually
reversed. If it isn't, we will revert to getting the full (in-order)
listing of versions and reversing it on the proxy.

Change-Id: Ib53574ff71961592426cb386ef00a75eb5824def
Closes-Bug: 1562083
2016-03-31 15:43:02 -07:00
Jenkins
e786d01192 Merge "Simplify policy-name validation slightly" 2016-03-30 21:01:17 +00:00
Tim Burke
7be55acf1b Simplify policy-name validation slightly
_validate_policy_name always either returns True or raises an exception.
Simplify it to just being a callable that may raise an exception.

Also, move the check for blank/None names into _validate_policy_name, so
it will be applied in more cases.

Change-Id: I7832a0c9c895cd75ba4c6d0e8b5568a3c8a0ea25
2016-03-29 19:41:23 -07:00
Jenkins
c4bff88b09 Merge "Fix account-reaper unable to delete all containers." 2016-03-30 00:39:23 +00:00
Jenkins
fe4672e529 Merge "Ignore files in the devices directory when auditing objects" 2016-03-29 18:14:02 +00:00
Jenkins
f8867fd6ff Merge "Fix py34 error of indexing 'dict_keys' object" 2016-03-29 10:21:27 +00:00
Clay Gerrard
7402d7d9cf Shutdown backend EC connection contexts on disconnect
When eventlet.wsgi closes an ECAppIter on client disconnect we need to
make sure our sub-iterators are also closed.  We already kill the
backend sockets, but the executing contexts are left running until
they timeout.  A slow client can result in needlessly holding queued
backend fragments until the client_timeout (default 60s).

Update associated test that exposed the problem to demonstrate the
issue more quickly.

Change-Id: Ibbc89449e7878fc4215e47e3f7dfe4ae58a2d638
2016-03-25 12:12:14 -07:00
Anh Tran
2f7d0f4a2a Removing some redundant words
This patch removes some redundant words.

Change-Id: Ia79717664b06ed9a41c3c5dcf1a25e9e49e21cf2
2016-03-25 17:20:24 +07:00
Janie Richling
e97c4f794d swift-[account|container]-info when disk is full
Extended the use of the DatabaseBroker "stale_reads_ok" flag to the
AccountBroker and ContainerBroker.  Now checks for an sqlite3 error
from the _commit_puts call that processes the pending files.

If this error is raised, then the stale_reads_ok flag will be checked
to determine how to proceed as opposed to simply raising.

The first time that print_info is attempted, the flag will be
false, but swift-[account|container]-info will check for the
raised exception.  If it was raised, then a warning is reported
that the data may be stale, and another attempt will be
made using the stale_reads_ok=True flag.

Change-Id: I761526eef62327888c865d87a9caafa3e7eabab6
Closes-Bug: 1531302
2016-03-24 20:11:24 -05:00
Jenkins
cfb0b6a029 Merge "Handle tempurl Content-Disposition header missing from HEAD" 2016-03-24 22:19:24 +00:00
David Liu
3407d737c7 Handle tempurl Content-Disposition header missing from HEAD
Content-Disposition headers should make no difference between
GET and HEAD according to HTTP rfc.

Closes-Bug: #1539805

Change-Id: Ifa41a7cda2f321eb8e36420ede7912ed0a549712
2016-03-24 16:12:46 +08:00
Alistair Coles
2f24fb9683 Check marker params in SimpleClient full listing requests
Follow up for change [1] to add some assertions to check that
marker param is included in sequential GET requests sent during
a full listing.

Extract multiple FakeConn class definitions to single class at
module level and share between all classes.

Also, explicitly unpack the return values from base request calls
made in the full listing section of base_request, and explicitly
return a list to make more consistent with rest of the method.

[1] Change-Id: I6892390d72f70f1bc519b482d4f72603e1570163

Change-Id: Iad038709f46364b8324d25ac79be4317add79df5
2016-03-23 23:14:06 +00:00
Christian Schwede
a696c1e89e Fix full_listing in internal_client
The internal_client is used in swift-dispersion-report, and in case one has more
than 10000 containers or objects these are not queried.

This patch adds support to the internal_client to iterate over all
containers/objects if the listing exceeds the default of 10000 entries and the
argument full_listing=True is used.

Closes-Bug: 1314817
Closes-Bug: 1525995
Change-Id: I6892390d72f70f1bc519b482d4f72603e1570163
2016-03-23 23:03:42 +00:00
Jenkins
4be3701805 Merge "Auditor will clean up stale rsync tempfiles" 2016-03-23 22:21:51 +00:00
Christian Schwede
51bea3943f Ignore files in the devices directory when auditing objects
The object auditor raises an exception if there are some files in
/srv/node (or any other defined "devices" directory). This change
simply skips any file in the devices directory when generating
locations for the object auditor.

Change-Id: I934594994adc577799723edb6c5648685682a9e7
2016-03-23 21:58:13 +00:00