4f617f49b6d854a0073525da5da7e9b97f0b6fa7
Commit Graph

2250 Commits

This Branch
This Branch
All Branches
Author SHA1 Message Date
John Dickinson
a2ac5efaa6 swift constraints are now settable via config
Change previously hard-coded constants into config variables. This
allows deployers to tune their cluster more specifically based on
their needs. For example, a deployment that uses direct swift access
for public content may need to set a larger header value constraint to
allow for the full object name to be represented in the Content-
Disposition header (which browsers check to determine the name of a
downloaded object).
The new settings are set in the [swift-constraints] section of
/etc/swift/swift.conf. Comments were also added to this config file.
Cleaned up swift/common/constraints.py to pass pep8 1.3.3
Funtional tests now require constraints to be defined in /etc/test.conf or in
/etc/swift/swift.conf (in the case of running the functional tests against a
local swift cluster). To have any hope of tests passing, the defined
constraints must match the constraints on the tested cluster.
Removed a ton of "magic numbers" in both unit and functional tests.
Change-Id: Ie4588e052fd158314ddca6cd8fca9bc793311465
2012年09月07日 11:18:42 -07:00
Jenkins
4bf5ee3850 Merge "Fix pep8 issues in test_memcached.py." 2012年09月07日 17:17:54 +00:00
dk647
3139760218 Fix pep8 issues
Fix pep8 issues in swift/obj/expirer.py
Change-Id: Iba80aa5010f0c23e7fe1e5abc230a1c7f76687a8
2012年09月07日 12:20:20 +08:00
dk647
cde6d597a7 Fix pep8 issues
Fix pep8 issues in swift/obj/auditor.py
Change-Id: Iae6fe2c7399fd52455d66ba57360e2f7d9e017f3
2012年09月07日 12:11:35 +08:00
Florian Hines
c0537ac6e0 Breakout search_devs & add get_builder() for reuse
This moves search_devs into RingBuilder to make it accessible to other utils
that need to search the builder. Along the same lines this also adds a
load() call to get a RingBuilder instance when working with the builder files.
- This adds python-mock >= 0.7 as a dependency for unittests. On Ubuntu
 10.04 you'll have to pip install it, on 12.04 you can apt-get install
 it. Fedora 17+ should be able to yum install it.
- new pep8 compliance
- Fixed a small issue (undefined var) in swift-ring-builder when remove was
called but failed to find a match.
Change-Id: I2e02684235aa2f4e901a00858ae037091594c545
2012年09月06日 20:16:46 -05:00
Jenkins
7f89e50eaf Merge "fix some format issure" 2012年09月06日 19:01:23 +00:00
Jenkins
58a924aebf Merge "fix some format" 2012年09月06日 18:55:37 +00:00
dk647
54e28fa21f fix some format
fix some format according to pep8
Change-Id: I8ceb266d92c8997f131fa4096aaa6cfd4d585aaa
2012年09月06日 14:28:55 +08:00
dk647
4d6ae96d92 fix some format issure
fir some format according to pep8
Change-Id: Iec8f67ea2166c955732bd598661140d4cfce6d40
2012年09月06日 14:14:43 +08:00
dk647
edaaa475b8 format some code according to pep8
format some code according to pep8
	modified: auditor.py
	modified: reaper.py
	modified: server.py
Change-Id: Ic6d8e000c711d17dcd9047cfeee7876b23ff0605
2012年09月06日 13:20:58 +08:00
Darrell Bishop
46a093f068 Obj replicator cleans up files where part dirs should be.
If a partition directory was a file instead of a directory, the
object-replicator would attempt to listdir() it, raise an exception, and
try again next iteration. This condition could arise after running
xfs_repair.
Now, collect_jobs() will reap any partition directories which are
actually files. Fixes bug 1045954.
Change-Id: Id65d3eab2effd61c3f6b25250611c88c907b2a16
2012年09月05日 23:54:16 +00:00
Jenkins
2b23eb3e41 Merge "Can run swift-bench across multiple cores/servers." 2012年09月05日 17:25:44 +00:00
Alex Yang
d56772a898 Fix pep8 issues in test_memcached.py.
Change-Id: Ieeee2411f84489ea106909e18e758fd170aa9bca
2012年09月05日 09:34:06 +08:00
Jenkins
6e8284ecbd Merge "Fall back to UDP if /dev/log does not exist." 2012年09月05日 00:32:57 +00:00
Constantine Peresypkin
73846c2c38 fix update_deleted directory creation. bug 1035274
Change-Id: Ie3423ce90d906948a1ce2db0efe3da184e60f6e0
2012年09月05日 00:26:57 +03:00
John Dickinson
07b4c21b42 1.7.1 version bump
Change-Id: I3684a5694844dac282c0e4274b68525732c42637
2012年09月04日 09:32:33 -07:00
John Dickinson
341da75574 changelog and authors updates for 1.7 release
Change-Id: Ie38e49915cfd233bcf00469f184cf8fce7424472
2012年09月04日 08:36:55 -07:00
Jenkins
93766cd28d Merge "Update swift.common.db to us swift.cmmn.utils.json" 2012年09月04日 15:35:37 +00:00
Jenkins
a8b8798f72 Merge "Fix PEP8 issues in ./test/unit/common ." 2012年09月04日 14:48:59 +00:00
gholt
2e16b1f1e5 Update swift.common.db to us swift.cmmn.utils.json
Change-Id: Ib4baac7b8b24d7fd982c71591deda3a096f470f2
2012年09月04日 14:41:12 +00:00
Soren Hansen
314d3b7a85 Fall back to UDP if /dev/log does not exist.
If /dev/log does not exist, swift.common.utils.get_logger would fail as
it only handles the situation where /dev/log isn't a socket.
Fixes bug 1045820
Change-Id: I2c33e0fa7f88f03d5b0495779832ed4de7c496da
2012年09月04日 15:43:38 +02:00
Michael Barton
0bb5d6da13 use simplejson to serialize acct/cont results
I did some benchmarking, and it's just a lot faster to use simplejson
to serialize account and container listings.
Change-Id: Ib0f751d9a5b6f4020031e952986811f0be090cce
2012年09月02日 23:55:53 -07:00
John Dickinson
54a290718c bumped version to 1.7.0 to reflect current dev effort
Change-Id: I5423c8bf11b14f862cb321583d91991177fce5eb
2012年08月31日 14:22:56 -07:00
lrqrun
7b664c99e5 Fix PEP8 issues in ./test/unit/common .
Fix some pep8 issues in
 modified: test_bufferedhttp.py
 modified: test_constraints.py
 modified: test_db.py
 modified: test_db_replicator.py
 modified: test_init.py
make the code looks pretty.
Change-Id: I1c374b1ccd4f028c4e4b2e8194a6d1c201d50571
2012年08月31日 11:24:46 +08:00
Darrell Bishop
ed3b12d05c Can run swift-bench across multiple cores/servers.
You run one or more swift-bench-client processes like this:
 $ swift-bench-client 127.0.0.1 20001
 $ swift-bench-client 127.0.0.1 20002
Then you run swift-bench with a new option, --bench-clients (-b), which is
specified once for each swift-bench-client:
 $ swift-bench -b 127.0.0.1:20001 -b 127.0.0.1:20002
You get log lines from each client (interleaved) along with a final report
for all clients:
 127.0.0.1:20002 swift-bench-server 2012年08月25日 22:44:06,148 INFO Auth version: 1.0
 127.0.0.1:20001 swift-bench-server 2012年08月25日 22:44:06,148 INFO Auth version: 1.0
 127.0.0.1:20001 swift-bench-server 2012年08月25日 22:44:12,249 INFO 83 PUTS [0 failures], 41.5/s
 127.0.0.1:20002 swift-bench-server 2012年08月25日 22:44:14,430 INFO 74 PUTS [0 failures], 34.3/s
 ...
 127.0.0.1:20002 swift-bench-server 2012年08月25日 22:45:18,942 INFO Auth version: 1.0
 127.0.0.1:20002 swift-bench-server 2012年08月25日 22:45:20,946 INFO 238 DEL [2 failures], 118.9/s
 swift-bench 2012年08月25日 22:45:27,549 INFO 2000 PUTS **FINAL** [0 failures], 56.8/s
 swift-bench 2012年08月25日 22:45:27,550 INFO 30000 GETS **FINAL** [50 failures], 974.6/s
 swift-bench 2012年08月25日 22:45:27,550 INFO 2000 DEL **FINAL** [20 failures], 237.1/s
The concurrency, PUT count, and GET count config settings are divided by
the number of bench_clients. In other words, the same volume of work is
attempted (vs. not specifying --bench-clients), but it can now span
servers and CPU cores.
Benchmark containers are created (if use_proxy = yes) and deleted (if
delete = yes), with appropriate concurrency, in the initiating
swift-bench process, not any of the swift-bench-client processes.
Change-Id: Idbf31a23093244ab357a9bf77e6031257774f24a
2012年08月30日 18:22:49 +00:00
Darrell Bishop
4a2ae2b460 Upating proxy-server StatsD logging.
Removed many StatsD logging calls in proxy-server and added
swift-informant-style catch-all logging in the proxy-logger middleware.
Many errors previously rolled into the "proxy-server.<type>.errors"
counter will now appear broken down by response code and with timing
data at: "proxy-server.<type>.<verb>.<status>.timing". Also, bytes
transferred (sum of in + out) will be at:
"proxy-server.<type>.<verb>.<status>.xfer". The proxy-logging
middleware can get its StatsD config from standard vars in [DEFAULT] or
from access_log_statsd_* config vars in its config section.
Similarly to Swift Informant, request methods ("verbs") are filtered
using the new proxy-logging config var, "log_statsd_valid_http_methods"
which defaults to GET, HEAD, POST, PUT, DELETE, and COPY. Requests with
methods not in this list use "BAD_METHOD" for <verb> in the metric name.
To avoid user error, access_log_statsd_valid_http_methods is also
accepted.
Previously, proxy-server metrics used "Account", "Container", and
"Object" for the <type>, but these are now all lowercase.
Updated the admin guide's StatsD docs to reflect the above changes and
also include the "proxy-server.<type>.handoff_count" and
"proxy-server.<type>.handoff_all_count" metrics.
The proxy server now saves off the original req.method and proxy_logging
will use this if it can (both for request logging and as the "<verb>" in
the statsd timing metric). This fixes bug 1025433.
Removed some stale access_log_* related code in proxy/server.py. Also
removed the BaseApplication/Application distinction as it's no longer
necessary.
Fixed up the sample config files a bit (logging lines, mostly).
Fixed typo in SAIO development guide.
Got proxy_logging.py test coverage to 100%.
Fixed proxy_logging.py for PEP8 v1.3.2.
Enhanced test.unit.FakeLogger to track more calls to enable testing
StatsD metric calls.
Change-Id: I45d94cb76450be96d66fcfab56359bdfdc3a2576
2012年08月29日 16:08:30 -07:00
gholt
c509ac2371 Added ability to disable fallocate
Change-Id: Id8872c581ed23378a8e14cbf3bf049b5c0d21577
2012年08月29日 19:57:26 +00:00
Jenkins
859afd6f49 Merge "Remove the gettext wrapper of server_type." 2012年08月29日 18:19:17 +00:00
Jenkins
6e524a3a72 Merge "Misc. swift-bench improvements." 2012年08月29日 01:28:50 +00:00
Jenkins
e375e7edd7 Merge "Do not use pickle for serialization in memcache, but JSON" 2012年08月28日 21:39:57 +00:00
Jenkins
78dacc4663 Merge "x-newest cleanup code with test. Fixes bug 1037337" 2012年08月28日 20:09:00 +00:00
John Dickinson
eb5f89ac25 fallocate call error handling
fallocate() failures properly return HTTPInsufficientStorage from
object-server before reading from wsgi.input, allowing the proxy
server to error_limit that node.
Change-Id: Idfc293bbab2cff1e508edf58045108ca1ef5cec1
2012年08月28日 10:25:33 -07:00
Alex Yang
2a38a04092 Remove the gettext wrapper of server_type.
The gettext wrapper of server_type in controllers is used to translate
server_type in log. But the transfer_headers function which used to
filter the illegal metadata headers use the wrapped server_type. So, it
will cause problems that 'X-Account-Meta-' and 'X-Container-Meta-' would
be filtered when the language of operating system is not english, such
as Chinese or Japnese. So, I removed the wrapper.
Change-Id: I7d47e67b4caf5d0be171a90740f9bb12fa2cba84
Fixes: Bug #1042142 
2012年08月28日 10:51:49 +08:00
Constantine Peresypkin
9290471b61 x-newest cleanup code with test. Fixes bug 1037337
Change-Id: Ie99250250171246e8c13e8d8c8258101bd78cce4
2012年08月28日 01:59:26 +03:00
Darrell Bishop
9bda92d54a Misc. swift-bench improvements.
swift-bench now honors the environment variables, ST_AUTH, ST_USER, and
ST_KEY like python-swiftclient does.
Added --lower-object-size (or -l) command-line option which, if
specified, will turn a specified --object-size into --upper-object-size.
It will raise a ValueError if --object-size is not specified or is <=
--lower-object-size.
BenchController how handles SIGINT (KeyboardInterrupt) similarly to the
swift command-line client: the first Ctrl-C will make it fast-track to
completion (no new PUT or GET operations are started, but everything PUT
is DELETE'ed). A second Ctrl-C will immediately exit. The behavior for
SIGTERM is unchanged (a single SIGTERM will immediately terminate the
process).
Added a sample configuration file for swift-bench, with documenting
comments.
Change-Id: I6f394ad995300fc8af3d565d95c3b45559ee510a
2012年08月27日 20:25:44 +00:00
Jenkins
e630e7c9d6 Merge "Remove redefinition of import traceback" 2012年08月27日 20:23:11 +00:00
Alex Yang
28bff36b81 Remove redefinition of import traceback
Removed the redefinition of import in swift/object/server.py
Add my name in AUTHORS
Change-Id: Ia74df662de08fc52b92b828978d96a22b5df5597
2012年08月27日 09:55:06 +08:00
Darrell Bishop
1a6c42fccd Fix when rate_limit_after_segment kicks in.
If rate_limit_after_segment was 10 in the proxy config, then after 10
segments were coughed up by _load_next_segment() with no calls to
sleep(), the 11th segment would not trigger a sleep() call. The 12th
segment triggered a sleep(0) call, but it was only after the 13th
segment was loaded that an actual rate-limiting (non-zero) sleep got
called.
With this patch, a rate_limit_after_segment of 10 will start sleeping
the correct amount after the 11th segment.
Updated proxy-server.conf-sample with rate_limit_after_segment and
rate_limit_segments_per_sec.
Change-Id: I937c366996e6d6ab47c614d6db470e3be9657c07
2012年08月23日 17:20:08 -07:00
Jenkins
d8c02dccc0 Merge "split proxy controllers into individual modules" 2012年08月23日 23:08:03 +00:00
Jenkins
3f01f889d5 Merge "make obj replicator locking more optimistic" 2012年08月23日 22:06:35 +00:00
Michael Barton
eb4af8f840 split proxy controllers into individual modules
This is a pretty mechanical change that moves proxy controller
classes to their own files.
Change-Id: Iabb7bc134b07193e3bcc041a5c6890a0b95c2b55
2012年08月23日 12:44:03 -07:00
Jenkins
1712135a7e Merge "Add device name to *-replicator.removes for DBs" 2012年08月22日 21:11:18 +00:00
Jenkins
4f0226e4f8 Merge "Retuen a reasonable response to client." 2012年08月22日 21:00:14 +00:00
Darrell Bishop
66400b7337 Add device name to *-replicator.removes for DBs
To tell when replication for a device has finished, it's important to
know when the replicator is removing objects. This was previously
handled for the object-replicator
(object-replicator.partition.delete.count.<device> and
object-replicator.partition.update.count.<device> metrics) but not the
account and container replicators.
This patch extends the existing DB removal count metrics to make them
per-device. The new metrics are:
 account-replicator.removes.<device>
 container-replicator.removes.<device>
There's also a bonus refactoring and increased test coverage of the DB
replicator code.
Change-Id: I2067317d4a5f8ad2a496834147954bdcdfc541c1
2012年08月22日 13:35:09 -07:00
Michael Barton
da0e013d98 make obj replicator locking more optimistic
Basically, do all hashing in the replicator without a lock, then
lock briefly to rewrite the hashes file. Retry if someone else has
modified the hashes file in the mean time (which should be rare).
Also, a little refactoring.
Change-Id: I6257a53808d14b567bde70d2d18a9c58cb1e415a
2012年08月22日 13:09:35 -07:00
Jenkins
82f1d550b6 Merge "Fix PEP8 issues." 2012年08月22日 19:47:15 +00:00
Jenkins
665556b500 Merge "Update docs for new ring serialization." 2012年08月22日 19:12:49 +00:00
Ray Chen
7ebb81c0f6 Fix PEP8 issues.
Fix a PEP8 issues in doc/source/conf.py to make the code pretty.
Change-Id: I71d36ebb59d44ba145ca13e4f4827139f0466d78
2012年08月22日 12:20:30 +08:00
Jenkins
1678da2f59 Merge "Add nosehtmloutput as a test dependency." 2012年08月22日 00:53:39 +00:00
Jenkins
8c369a3361 Merge "A couple minor tweaks to the SAIO guide." 2012年08月22日 00:39:43 +00:00