b852f2274b9dc179ffb636091d80d1bb5e90841d
Commit Graph

802 Commits

Author SHA1 Message Date
clayg
b852f2274b capture resetswift output in probetests
This change makes the dots prettier during probetests
When calling the resetswift script, the probetests will use subprocess
to redirect stderr to stdout and capture stdout into a buffer. We print
the captured buffer from resetswift's combined stdout/stderr and let
nosetests stdout capturing handle printing the output for debug only if a
test fails.
Change-Id: I022512f2ef5a4c43b0e49264bad1bca98c1f0299
2012年12月06日 22:34:28 -08:00
Jenkins
13937ad696 Merge "bp/cross-tenant-acls: allow tenantId:user, tenantName:user, and *:user ALCs" 2012年12月05日 19:48:24 +00:00
Jenkins
7e8959ff0a Merge "drop_privileges should also set HOME" 2012年12月04日 20:08:29 +00:00
Jenkins
db6d62a162 Merge "Allow optional, temporary healthcheck failure." 2012年12月04日 19:43:50 +00:00
Darrell Bishop
b8e3e9e1c2 Allow optional, temporary healthcheck failure.
A deployer may want to remove a Swift node from a load balancer for
maintenance or upgrade. This patch provides an optional mechanism for
this. The healthcheck filter config can specify "disable_path" which is
a filesystem path. If a file is present at that location, the
healthcheck middleware returns a 503 with a body of "DISABLED BY FILE".
So a deployer can configure "disable_path" and then touch that
filesystem path, wait for the proxy to be removed from the load balancer
pool, perform maintenance/upgrade, and then remove the "disable_path"
file.
Also cleaned up the conf file man pages a bit.
Change-Id: I1759c78c74910a54c720f298d4d8e6fa57a4dab4
2012年12月04日 09:14:27 -08:00
Eugene Kirpichov
772da0a004 drop_privileges should also set HOME
E.g. if HOME is not set, swift-proxy will create the
keystone_signing file not in HOME but in /root.
This is because the swift user doesn't have a shell
in /etc/passwd and so it doesn't set environment variables
when impersonating.
Change-Id: I3013007e0dadf6ddccc176e142b7c78c5d63a351
2012年12月04日 12:13:27 +00:00
Jenkins
8a6922b73e Merge "406 if we can't satisfy Accept" 2012年12月03日 23:20:10 +00:00
Michael Barton
064ee2b583 406 if we can't satisfy Accept
The container and account servers should respond with 406 if the Accept header
isn't satisfiable. This behavior is defined in RFC 2616 section 14.1.
Change-Id: I8a67ccafe33dc70ef4f7794686a54fbc8581f4dc
2012年12月03日 11:42:37 -08:00
Guang Yee
795acd40f1 bp/cross-tenant-acls: allow tenantId:user, tenantName:user, and *:user ALCs
Change-Id: I7cfe77b3f03172814814f2e2bae04a3ae184efb0
2012年11月30日 13:53:00 -08:00
gholt
6743e4d57f Swob bugfixes; for ? in names specifically
It was discovered that uploading items with ? in their names (encoded
with %3F of course) made Swob fail in that it trimmed off everything
after the ? as if it were a query string.
Change-Id: Ie686db9a2177aafad2e77c307ffc3f446646fbb5
2012年11月30日 21:31:21 +00:00
Jenkins
a830b6ffc9 Merge "Fix for container sync not syncing last rowid" 2012年11月29日 20:21:45 +00:00
Jenkins
02429858de Merge "Fix bug with swob.Request.path_info_pop" 2012年11月28日 23:11:13 +00:00
gholt
4063123e3c Fix bug with swob.Request.path_info_pop
path_info_pop didn't behave as the webob one did with single segment
paths like /one and with root-only paths /
Now it should.
Change-Id: Ib88344de386ab9e8975e7f48c1afc47731992ee2
2012年11月28日 00:08:26 +00:00
Jason Johnson
48ebd6732e Replace hard-coded test accounts with user-configured values
Change-Id: I824ba5f231e252b923abc895f757137855a93d3a
2012年11月27日 10:39:12 -06:00
Dan Hersam
923b8b95c3 Fix for container sync not syncing last rowid
Bug 1079439
Change-Id: I1985a7176f34931ecb0f24c0289f18df5e934598
2012年11月19日 23:09:17 +00:00
Jenkins
cb55f0c3a8 Merge "Fix lazy-listing of object segments." 2012年11月19日 15:28:20 +00:00
Samuel Merritt
357b12dc2b Remove IP-based container-sync ACLs from auth middlewares.
The determination of the client IP looked at the X-Cluster-Client-Ip
and X-Forwarded-For headers in the incoming HTTP request. This is
trivially spoofable by a malicious client, so there's no security
gained by having the check there.
Worse, having the check there provides a false sense of security to
cluster operators. It sounds like it's based on the client IP, so an
attacker would have to do IP spoofing to defeat it. However, it's
really just a shared secret, and there's already a secret key set
up. Basically, it looks like 2-factor auth (IP+key), but it's really
1-factor (key).
Now, the one case where this might provide some security is where the
Swift cluster is behind an external load balancer that strips off the
X-Cluster-Client-Ip and X-Forwarded-For headers and substitutes its
own. I don't think it's worth the tradeoff, hence this commit.
Fixes bug 1068420 for very small values of "fixes".
DocImpact
Change-Id: I2bef64c2e1e4df8a612a5531a35721202deb6964
2012年11月16日 18:47:06 -08:00
Jenkins
d13869e64b Merge "Refactor DiskFile to hide temp file names and exts" 2012年11月16日 22:58:39 +00:00
Jenkins
4e2ffff606 Merge "Use a delta timeout for memcache where possible" 2012年11月16日 22:36:01 +00:00
Samuel Merritt
83bbd0aef2 Fix lazy-listing of object segments.
When responding to a GET request for a manifest, it was intended that
the proxy server lazily fetch the pieces of the container
listing. That way, a single client request doesn't immediately turn
into a bunch of requests to backends. The additional requests should
only get made if the client is putting in the work of receiving the
object body.
However, commit 156f27c accidentally changed this so that all the
pieces of the container listing are eagerly fetched up-front. Better
yet, if an object has more than CONTAINER_LISTING_LIMIT (default
10,000) segments, the container listing is then fetched a second time,
albeit lazily, while streaming out the response.
This commit restores the laziness and adds tests for it.
Change-Id: I49840a7059e6f999ce19199ecb10cdb77358526b
2012年11月16日 13:12:58 -08:00
Jenkins
4d50728c8e Merge "change catch_errors to use WSGIContext" 2012年11月16日 19:59:08 +00:00
Peter Portante
1ac7b88a27 Use a delta timeout for memcache where possible
We use a delta timeout value for timeouts under 30 days (in seconds)
since that is the limit which the memcached protocols will recognize a
timeout as a delta. Greater than 30 days and it interprets it as an
absolute time in seconds since the epoch.
This helps to address an often difficult-to-debug problem of time
drift between memcache clients and the memcache servers. Prior to this
change, if a client's time drifts behind the servers, short timeouts
run the danger of not being cached at all. If a client's time drifts
ahead of the servers, short timeouts run the danger of persisting too
long. Using delta's avoids this affect. For absolute timeouts 30 days
or more in the future small time drifts between clients and servers
are inconsequential.
See also bug 1076148 (https://bugs.launchpad.net/swift/+bug/1076148).
This also fixes incr and decr to handle timeout values in the same way
timeouts are handled for set operations.
Change-Id: Ie36dbcedfe9b4db9f77ed4ea9b70ff86c5773310
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2012年11月16日 14:57:36 -05:00
Jenkins
c85d2ace93 Merge "Refactor db_replicator's roundrobin_datadirs" 2012年11月16日 02:16:54 +00:00
gholt
4e5889d6ce Refactor db_replicator's roundrobin_datadirs
roundrobin_datadirs was returning any .db file at any depth in the
accounts/containers structure. Since xfs corruption can cause such
files to appear in odd places at times (only happened on one drive of
ours so far, but still...), I've refactored this function to only
return .db files at the proper depth.
Change-Id: Id06ef6584941f8a572e286f69dfa3d96fe451355
2012年11月15日 21:44:14 +00:00
John Dickinson
20d4b00645 change catch_errors to use WSGIContext
The current catch_errors (ie without this patch) relinquishes control
before the underlying middleware/app has been evaluated. This results
in not catching errors in the stack when they occur in either the
start_response or in generating the first chunk sent to the client of
the underlying stack.
Change-Id: Iecd21e4fc7e30fa20239d011f69216354b50baf1
2012年11月15日 13:18:38 -08:00
Peter Portante
7d70e05aeb Refactor DiskFile to hide temp file names and exts
This set of changes reworks the DiskFile class to remove the "extension"
parameter from the put() method, offering the new put_metadata() method with
an optional tombstone keyword boolean, and changes the mkstemp method to only
return the file descriptor.
Reviewing the code it was found that the temporary file name created as a
result of calling DiskFile.mkstemp() was never used by the caller, but the
caller was responsible for passing it back to the DiskFile.put() method. That
seems like too much information is exposed to the caller, when all the caller
requires is the file descriptor to write data into it.
Upon further review, the mkstemp() method was used in three places: PUT, POST
and DELETE method handling. Of those three cases, only PUT requires the file
descriptor, since it is responsible for writing the object contents. For POST
and DELETE, DiskFile only needs to associate metadata with the correct file
name. We abstract the pattern that those two use (once we also refactor the
code to move the fetch of the delete-at metadata, and subsequent
delete-at-update initiation, from under the mkstemp context) by adding the new
put_metadata() method.
As a result, the DiskFile class is then free to do whatever file system
operations it must to meet the API, without the caller having to know more
than just how to write data to a file descriptor. Note that DiskFile itself
key'd off of the '.ts' and '.meta' extensions for its operations, and for that
to work properly, the caller had to know to use those correctly. With this
change, the caller has no knowledge of how the file system is being used to
accomplish data and metadata storage.
See also Question 213796 at:
 https://answers.launchpad.net/swift/+question/213796
Change-Id: I267f68e64391ba627b2a13682393bec62600159d
Signed-off-by: Peter Portante <peter.portante@redhat.com>
2012年11月15日 08:58:26 -05:00
Jenkins
3a806a805c Merge "Fix 500 on GET of many-segment manifest." 2012年11月15日 00:32:16 +00:00
Jenkins
6b8f966364 Merge "Better TempAuth storage URL guessing" 2012年11月14日 21:10:18 +00:00
clayg
4236e6379b patch utils.HASH_PATH_SUFFIX in proxy unittests
Most of the test files set the HASH_PATH_SUFFIX so you can run the test
file stand alone. This change made it easier for me to run specific
proxy tests separately.
Change-Id: I87d70367dac7f240a2b6779649f8a02cf324ae0f
2012年11月12日 23:15:10 -08:00
Samuel Merritt
a78b2d5f46 Fix 500 on GET of many-segment manifest.
The proxy_logging middleware was asserting that the response contained
either a Content-Length header or a Transfer-Encoding header. If not,
it would either add one (if app_iter was a list) or blow up
(otherwise). This blowing up is observable on a GET request to a
manifest object that references more than
swift.common.constraints.CONTAINER_LISTING_LIMIT segments.
If a response makes it up to eventlet.wsgi without a Content-Length
header, then a "Transfer-Encoding: chunked" header is automatically
stuffed into the response by eventlet. Therefore, it's not an error
for a response to not have a Content-Length header, and proxy_logging
should just let it happen.
Fixes bug 1078113.
Change-Id: I3751a8ae14dc68bab546f2746b61267a5115e252
2012年11月12日 15:02:04 -08:00
gholt
47ee1d7e17 Better TempAuth storage URL guessing
I know it's just TempAuth, but bug #959953 just caught my eye as
something interesting to solve.
This does a best guess on the storage URL to return for a given
request. It allows $HOST to be used in the storage URL configuration,
where $HOST will resolve to scheme://host:port. It bases the scheme
on how the server is running or on storage_url_scheme if set. The
host:port comes from the request's Host header if it exists, and
falls back to the WSGI SERVER_NAME:SERVER_PORT otherwise.
Fixes: bug #959953
DocImpact
Change-Id: Ia494bcb99a04490911ee8d2cb8b12a94e77820c5
2012年11月10日 16:39:25 +00:00
John Dickinson
8a8ea8f22a fix error with setting max age and incorrect tests
Change-Id: I3f0db3b70ea5df323597b556682c2d1fb28afe53
2012年11月09日 14:45:12 -08:00
Jenkins
ee42e6fc72 Merge "Make DELETE requests to expired objects return 404." 2012年11月09日 20:17:15 +00:00
Michael Barton
34ca0f097c give swob default content-type
This should fix up the few remaining API regressions from swob, by giving all
responses a default content-type of "text/html; charset=UTF-8".
Change-Id: Ib3b859e63c5e8c4af6f7fe535947402b5df57399
2012年11月09日 10:44:26 -08:00
Jenkins
2194897e37 Merge "use Host: for location rewrites" 2012年11月09日 00:09:33 +00:00
Samuel Merritt
237a440cd1 Make DELETE requests to expired objects return 404.
It is already the case that a DELETE of a deleted object results in a
404, and GET/HEAD/POSTs to both expired and deleted objects result in
404s. However, a DELETE of an expired object resulted in a 202. This
change makes it consistent with the other verbs.
Fixes bug 1076245.
Change-Id: I793e62d72461a4fb9fb3404e10658ddcc4c3a7a6
2012年11月08日 15:27:24 -08:00
Michael Barton
65554ea32f charset for default responses
Set a utf-8 charset on default text/html responses.
Change-Id: Ic5f661bd475dca83763d4b55419ad031279e3ba1
2012年11月08日 15:23:04 -08:00
Michael Barton
188f834e0a use Host: for location rewrites
If the Host header is available, use it for making relative URLs absolute.
Otherwise, continue using SERVER_NAME.
Change-Id: Ifc028264ad1b122a2d5dff9d5528cb369090429f
2012年11月08日 15:16:19 -08:00
gholt
f46a4d8a2f Fixed bugs with internal client and object expirer
These bug fixes are lumped together because they all caused problems
with the object expirer doing its job.
There was a bug with the internal client doing listings that happened
to run across a Unicode object name for use as a marker.
There was a bug with the object expirer not utf8 encoding object
names it got from json listings, causing deletes to fail.
There was a bug with the object expirer url quoting object names when
calling the internal client's make_request, when make_request already
handles that.
Change-Id: I29fdd351fd60c8e63874b44d604c5fdff35169d4
2012年11月08日 00:05:35 +00:00
Jenkins
3af76e1096 Merge "statsd timing refactor" 2012年11月07日 01:27:56 +00:00
Michael Barton
3586f829b0 statsd timing refactor
Change-Id: I99d9ddfbcad0f88e75c49235c8317ea97237d4e4
2012年11月06日 15:39:25 -08:00
John Dickinson
ec75d1e343 add OPTIONS to proxy_logging configs and docs
Change-Id: I77e1d7fdcf217826402beeb7d583e3c7279c416c
2012年11月06日 15:13:01 -08:00
Jenkins
d64649d9e7 Merge "Better RFC support for OPTIONS and CORS preflight requests" 2012年11月06日 20:44:44 +00:00
John Dickinson
16ecc430ca Better RFC support for OPTIONS and CORS preflight requests
Ensures that the Allow header is set for 405 responses from the proxy,
as per RFC 2616.
CORS preflight requests now require both the Origin and Access-
Control-Request-Method headers to get a successful (200) response. The
draft spec defines errors as a response with a non-200 status code.
This patch sets the CORS error response code to 401 (Not Authorized).
A later patch may choose to make this configurable.
There is some ambiguity between RFC 2616 and the CORS draft spec
around what to do when a CORS request is made but the cluster has no
CORS information about the requested resource. This patch chooses to
return an error in this case because it is what would be simplest for
CORS client apps.
Further improvements to the OPTIONS verb not included in this patch
 include support of more top-level resources (eg / or /v1/) or
sending the configured constraints in the reponse body.
Change-Id: I40be059e8bbf3737dafc4e6fefa7598d05669c60
2012年11月05日 20:15:21 -08:00
Jenkins
f66248b973 Merge "Set content-type on account/container head" 2012年11月06日 02:07:07 +00:00
Michael Barton
0d1b42007b Set content-type on account/container head
Change-Id: Ib54fa5adb7539bebfbd6644064be9d7f4d7af9db
2012年11月05日 12:59:16 -08:00
Jenkins
e655cd89c3 Merge "re-use headers_to_container_info on container GET" 2012年11月02日 20:21:55 +00:00
yuan-zhou
ba3babadde Allow object-expirer to delete the last version of an object
Fix bug 1067677
When we delete a versioned object, the last version will be poped out from the
versiones container. When a versioned object is expired and deleted by object-
expirer, the last version is restored but remains in the versions container
instead of getting deleted. The reason is object-expirer will set
'X-If-Delete- At' header when deleteing an object. However this is for the
current version - not for the last version. When the object-server is trying
to delete the last version, the transaction will fail with error:
X-If-Delete-At and X-Delete-At do not match. Delete the 'X-If-Delete-At'
field in the later built delete request would help to solve this issue.
This patch, without the test, was first proposed by
Zhou Yuan <yuan.zhou@intel.com>.
Change-Id: I62c97e6a0f140888497e189129825865fb6f7966
2012年11月02日 11:49:33 -07:00
Jenkins
8a061c086a Merge "blueprint Multi-range support implementation" 2012年11月02日 18:16:28 +00:00
Jenkins
d70d3092c0 Merge "Handle down object servers in container-sync" 2012年11月02日 05:44:45 +00:00