9cb7751fad92bc237b62710b6f4926db69cb05bd
Commit Graph

2131 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
Samuel Merritt
9cb7751fad Remove double GET on range requests.
The proxy server's ObjectController was performing multiple GET
requests to the object server when processing requests with Range
headers. This was a workaround for a bug in the proxy server's
Controller.GETorHEAD_base method where a response code of 416 from the
object server was incorrectly treated as a bad response from the
backend, the same way a 404 or a 5xx would be.
A 416 (Requested Range Not Satisfiable) from the object server is now
considered a good response. Since the response headers from the object
server already include the X-Object-Manifest header, there's no need
to make a second request (sans Range header) to see if the object is a
manifest.
Bonus fix: updated message for status 416 to match RFC2616.
Bonus fix 2: removed a leftover debugging print() in
test/unit/proxy/test_server.py.
Fixes bug 1065869.
Change-Id: I156af0b463f02ef19a8cfe37092544a599d89b78
2012年10月24日 17:16:11 -07:00
Jenkins
cee685e11a Merge "Fix version requirement for mock library." 2012年10月23日 04:27:28 +00:00
Victor Rodionov
22a8adfcb9 path_qs for swob.Request
Add path_qs property to swob.Request. First of all this property
has webob.Request, also this property can be used in swift3 middleware
for generate canonical string, if webob will be replaced in swift3 with
swob (2b36fbd477).
Change-Id: Idf58096baaf7830dd0d624ea6c72eda1eb91ff0d
2012年10月22日 16:56:30 +04:00
Jenkins
bdafc29fd9 Merge "Make StatsD tests less flaky." 2012年10月19日 18:26:07 +00:00
Jenkins
67d1017d8a Merge "do not dump_recon_cache on limited obj replic" 2012年10月19日 18:04:10 +00:00
Jenkins
83d9cd6606 Merge "Remove replication prioritization" 2012年10月19日 16:59:09 +00:00
Jenkins
425ca1ff70 Merge "Relax mount point name checking." 2012年10月19日 15:39:27 +00:00
Jenkins
43ee6396ae Merge "fix empty body getter bug 1067923" 2012年10月19日 15:09:55 +00:00
gholt
25ee63a943 Remove replication prioritization
Turns out this prioritization causes stampedes right after capacity
additions (especially on smaller clusters), which means the things it
prioritizes don't get done for several passes anyway, which means the
prioritization isn't solving the problem it was designed to do, and
it causes non-productive load spikes instead. :/
Getting rid of the prioritization doesn't make things go any slower
overall, could make things actually go faster since there are less
collisions, and evens out the load.
Change-Id: I4938bcd12d9a21fad635cfe772897e4c151f8a95
2012年10月19日 00:50:25 +00:00
John Dickinson
4c76f3dc3c removed duplicate in AUTHORS file
Change-Id: Ia430637f24d883ee166cb6529dde03049cc06120
2012年10月18日 12:37:50 -07:00
Victor Lowther
956cc0c793 Relax mount point name checking.
In general, Linux does not care about what a mount point is named as
long as it is a vaild directory name (no / or null characters).
However, that is too relaxed for swift, which will pass that mount
point name around as part of url path construction all over the
place. To make sure that the mount point name was sane from that POV,
Swift was using isalnum to verify that the mount point name was sane,
which is overly restrictive.
This patch replaces that test with a test that verifies that the name
has no characters that need to be URL encoded.
The specific use case this enables is allowing mount points to be
named according to the UUID of the filesystem that is being mounted,
which will make Swift more robust in the face of device name instability.
Change-Id: I4d49b21c1783e97c16d3f394c2171f1f80eea058
2012年10月18日 11:24:18 -05:00
Jenkins
711df677cb Merge "Random pep8 fixes!" 2012年10月16日 19:28:26 +00:00
Jenkins
58df647aaa Merge "fix bug with swob.Request accept property" 2012年10月16日 18:51:45 +00:00
Samuel Merritt
646651260a Make StatsD tests less flaky.
There have been a bunch of Jenkins failures lately where the StatsD
tests fail because they can't bind to their desired port. There's
nothing special about the particular port they're using, so now we let
the kernel pick an available one for us.
This also lets us get rid of a sleep() in the test that looked like an
attempt to alleviate EADDRINUSE errors, so now in the happy case, the
tests are a few fractions of a second faster.
Change-Id: Idee11349254107a59643539b1566f3588eee7ef4
2012年10月16日 11:17:11 -07:00
David Goetz
b52538074e do not dump_recon_cache on limited obj replic
Change-Id: I38e38607ba9c5cf331c216e4c81582d23c58eeca
2012年10月15日 14:21:02 -07:00
Samuel Merritt
e76b82c91b Fix version requirement for mock library.
One of the tests uses mock.call, which is only available in version
0.8.0 and up.
Fixes bug 1066274.
Change-Id: I77e4de0908f93326992fc4d4af4a7e54e60b5585
2012年10月14日 08:02:09 -07:00
Tom Fifield
9344a4a582 Random pep8 fixes!
This patch merely fixes a selection of files to the point where
pep8 1.3.3 is happy. Most of the errors are indentation related to
continued lines (E126, E127, E128), bracket positions (E124) and the
use of backslash (E502).
Patch 2 fixes David's comments regarding backslash and an odd comment
 - thanks David!
Change-Id: I4fbd77ecf5395743cb96acb95fa946c322c16560
2012年10月13日 12:04:25 +11:00
Samuel Merritt
4cf96b3791 Honor sample_rate in StatsD logging.
It's there to let administrators turn down the barrage of stats data
that StatsD must cope with, but it wasn't actually honored. Worse, if
the sample rate was set to e.g. 0.2, the stats would all be multiplied
by its inverse, e.g. 2. This patch actually drops packets when
sample_rate < 1, so you get correct measurements.
Fortunately, the default sample rate is 1 (i.e. drop nothing), and
multiplying by 1/1 doesn't change anything, so stats with the default
sample rate of 1.0 are, and have been, just fine.
Fixes bug 1065643.
Also, make the two touched files compliant with pep8 v1.3.3.
Change-Id: I66663144009ae4c9ee96f6a111745d8f5d2f5ca3
2012年10月12日 12:38:33 -07:00
Victor Rodionov
583850e866 fix bug with swob.Request accept property
Change-Id: I2c1246b9bbd1d3ab22c2a035b735d937dd90da11
2012年10月12日 16:53:10 +04:00
Constantine Peresypkin
b304a15b0b fix empty body getter bug 1067923
Change-Id: Ifd609f305ee878c39ea4e6840ed8fa9369595cfa
2012年10月12日 08:17:57 +02:00
Jenkins
8cacf5aaf8 Merge "fixed internal client things" 2012年10月11日 19:48:39 +00:00
Jenkins
e61fa389b3 Merge "Allows removal of ACLs" 2012年10月11日 17:35:44 +00:00
Greg Lange
52baf4eee4 fixed internal client things
_get_metadata() should only look for metadata on 200 family http status codes
in the path_parts() in the internal client test file should return distinct unicode strings
with spaces for account, container, and obj
Change-Id: I74e335d3b73a59092a0eec06539f4931420061dd
2012年10月11日 15:37:56 +00:00
Tom Fifield
124e75bc1b Allows removal of ACLs
fixes bug 1049017
As per the bug report, the -remove- form of deletion only works with
 meta headers and not with x-container-read and x-container-write.
This patch by Yukihiro KAWADA detects the container acls and sends
them through to the backend empty like the other metadata values.
patch2 extends metadata-helper in ContainerController tests so that
the new functionality can be tested.
patch3 changes the k.lower().startswith() commands for read/write to
a single k.lower - thanks David :)
patch4 fixes PEP8
patch5 fixes more than two hundred pep8 errors. Except one,
 where the pep8 tool complains of overindent, or underindent
depending on the position on the line. No idea how to fix that one.
patch6 fixes the remaining pep8 error - thanks Darrell
Change-Id: I36c2dd72b4636136c5ce7db414bf2b61501090ad
2012年10月11日 10:16:35 +11:00
Jenkins
89845bc811 Merge "Fix two edge cases with Range: header" 2012年10月09日 20:18:15 +00:00
Jenkins
dc717ea57e Merge "fix swob for make_pre_authed_request" 2012年10月09日 18:59:31 +00:00
Jenkins
3602e2e2a1 Merge "Fixing alterations to sys.path" 2012年10月09日 18:17:23 +00:00
David Goetz
7f476d7b48 fix swob for make_pre_authed_request
Change-Id: Ic263f4a77a0aa0eb40078772a567eb41a60e40f7
2012年10月09日 09:19:29 -07:00
Jenkins
512bf3b67d Merge "internal client unicode paths" 2012年10月09日 16:12:51 +00:00
Derek Higgins
387744197e Fixing alterations to sys.path
Fixes bug 1064249
sys.path should be extended not appended to
Change-Id: I3404a50b16b843b47f5082676029a4dd3b03f812
2012年10月09日 09:58:06 +01:00
Jenkins
fc1c5a5fd0 Merge "remove configobj from deps" 2012年10月09日 00:00:03 +00:00
Victor Rodionov
4bc1b1f185 fix typing in swift/common.db, swift/container/server.db
Change-Id: I5efb3712faa7d159be2d86913fa5fbdf09b7f98f
2012年10月09日 01:37:46 +04:00
Michael Barton
c7e2e9a1f3 remove configobj from deps
Change-Id: Ie566e712ba0d3dca543e99efbdb576b19623e73c
2012年10月08日 14:20:00 -07:00
Darrell Bishop
e2b03267fd Fix two edge cases with Range: header
This fixes swob to handle "Range: bytes=-X" where X > len(content); ex.
"Range: bytes=-17" when the object has 10 bytes. Based on the RFC, the
range is satisfiable and all bytes should be returned.
It also fixes "Range: bytes=-0" to be, correctly, not satisfiable. In
addition, this case's response has Content-Length: 0 and has a zero-byte
body.
It also fixes an existing regression in swob for the case
"Range: bytes=100-" for a body of length < 100 (Content-Length was
negative and the body was returned).
The relevant RFC is 2616, section 14.35.1.
Change-Id: Ib3dc672e083173eb970c10801283813623f26e0e
2012年10月07日 15:53:08 -07:00
Jenkins
1ef17d8284 Merge "add support for custom log handlers" 2012年10月05日 21:34:48 +00:00
Florian Hines
92826d0602 add support for custom log handlers
Add a hook to get_logger to run custom functions to add custom log
handlers or the like.
Change-Id: Ib04b12939dcac7e4ad6453dea9795682044c6ae0
2012年10月05日 15:56:34 -05:00
Greg Lange
e7f3a9865e internal client unicode paths
made internal client handle unicode path parts by adding make_path method
fixed pep8 problems in internal client and its test
moved internal client unit test file to correct directory
Change-Id: Id1c81c9cb0db05342e4e8a8393db93552fda4647
2012年10月05日 18:57:24 +00:00
Victor Rodionov
5b02fded4e cleanup double repeated response.headers['X-Timestamp'] = file.metadata['X-Timestamp']
in swift.obj.server.HEAD
Change-Id: Ie7cf853319589db7c48836dd5d7fd5e68cb009cd
2012年10月04日 02:47:22 +04:00
Jenkins
6801920785 Merge "close_swift_conn is a method of swift.proxy.controllers.base.Controller, not function" 2012年10月03日 21:25:21 +00:00
Jenkins
026846c7b5 Merge "local WSGI Request and Response classes" 2012年10月03日 20:49:05 +00:00
Victor Rodionov
0b756d75c4 close_swift_conn is a method of swift.proxy.controllers.base.Controller, not function
Change-Id: I84dd7bc2fc5ebd1190a7184f42fc5ecf5fd7b4d3
2012年10月04日 00:48:25 +04:00
Darrell Bishop
57ebd17910 Warn when killing fails with EPERM
Have swift-init warn when the running user doesn't have permissions to
signal processes. Fixes bug 1017494.
Change-Id: Icb9048ab36f1ca73bb93b11c9c2aed882d99dfa7
2012年10月03日 08:28:36 -07:00
Jenkins
550e876869 Merge "Allow underscores in account/user in tempauth via encoding." 2012年10月02日 23:42:59 +00:00
Jenkins
a0d96b184d Merge "catch no such file in hash_suffix" 2012年10月02日 18:49:02 +00:00
David Goetz
6f9473d31d catch no such file in hash_suffix
Change-Id: I70ee55d12b1ca91fdfe4891c3f82ab0f832f15d3
2012年10月02日 10:42:28 -07:00
Darrell Bishop
5582f166c2 Allow underscores in account/user in tempauth via encoding.
This patch introduces a new user format to tempauth which starts with
"user64_" and in which the account and user are base64 encoded (sans
padding equal signs):
user64_<account_b64>_<user_b64> = <key> [group] [group] [...] [storage_url]
This allows unambiguous parsing and adds the ability to have a user or
account name containing underscores.
The handling of tempauth configuration is fully backward compatible and
this only adds new, optional functionality.
Also beefed up unit tests to get full coverage of the user parsing code
in tempauth's __init__().
Change-Id: Id06304934ab8055a28921f2e1aa3c58a2036d8f8
2012年10月02日 09:05:22 -07:00
Michael Barton
5e3e9a882d local WSGI Request and Response classes
This change replaces WebOb with a mostly compatible local library,
swift.common.swob. Subtle changes to WebOb's API over the years have been a
huge headache. Swift doesn't even run on the current version.
There are a few incompatibilities to simplify the implementation/interface:
 * It only implements the header properties we use. More can be easily added.
 * Casts header values to str on assignment.
 * Response classes ("HTTPNotFound") are no longer subclasses, but partials
 on Response, so things like isinstance no longer work on them.
 * Unlike newer webob versions, will never return unicode objects.
Change-Id: I76617a0903ee2286b25a821b3c935c86ff95233f
2012年09月28日 14:48:48 -07:00
Jenkins
f0bd91dd14 Merge "allow replicator run_once to check specific devices/partitions" 2012年09月28日 21:24:36 +00:00
Jenkins
e6d720cde5 Merge "Fix errors with fdatasync on BSD platforms" 2012年09月28日 21:13:36 +00:00
David Goetz
a6c44d2764 allow replicator run_once to check specific devices/partitions
Change-Id: If45f77fda269ae6e251579542e70eb71bd11fe2a
2012年09月28日 12:24:15 -07:00