1886 Commits

Author SHA1 Message Date
Jenkins
a74cd3b01b Merge "Remove swift3 from here." 2012-05-24 15:30:17 +00:00
Jenkins
86ddaab942 Merge "!! Changed db_preallocation to False" 2012-05-24 15:28:34 +00:00
Jenkins
0a79be6e91 Merge "Clean up weird test code" 2012-05-24 10:24:38 +00:00
Chmouel Boudjnah
d02a73f4a9 Remove swift3 from here.
- Reference https://github.com/fujita/swift3 in associated_projects.
- Implements blueprint add-associated-projects-docs.

Change-Id: I48ef4c03449edf6ef4fda1a391228cacac7d2ac6
2012-05-24 10:21:42 +02:00
John Dickinson
1e90b61076 Re-add cname lookup and domain remap middleware
Revert "removed cname lookup middleware"

This reverts commit b47bcf19e41e862ca84d77a7b8843f836e084b6a.

Revert "removed domain remap middleware"

This reverts commit 317cf868bdf66dbc17c02d4ca383efafa5e2f229.

Change-Id: I260498d555c93b28896ace48a6f0e96701cbcc38
2012-05-21 20:02:04 -05:00
gholt
9eb797b099 !! Changed db_preallocation to False
Long explanation, but hopefully answers any questions.

We don't like changing the default behavior of Swift unless there's a
really good reason and, up until now, I've tried doing this with this
new db_preallocation setting.

For clusters with dedicated account/container servers that usually
have fewer disks overall but SSD for speed, having db_preallocation
on will gobble up disk space quite quickly and the fragmentation it's
designed to fight isn't that big a speed impact to SSDs anyway.

For clusters with account/container servers spread across all servers
along with object servers usually having standard disks for cost,
having db_preallocation off will cause very fragmented database files
impacting speed, sometimes dramatically.

Weighing these two negatives, it seems the second is the lesser evil.
The first can cause disks to fill up and disable the cluster. The
second will cause performance degradation, but the cluster will still
function.

Furthermore, if just one piece of code that touches all databases
runs with db_preallocation on, it's effectively on for the whole
cluster. We discovered this most recently when we finally configured
everything within the Swift codebase to have db_preallocation off,
only to find out Slogging didn't know about the new setting and so
ran with it on and starting filling up SSDs.

So that's why I'm proposing this change to the default behavior.

We will definitely need to post a prominent notice of this change
with the next release.

Change-Id: I48a43439264cff5d03c14ec8787f718ee44e78ea
2012-05-22 00:30:47 +00:00
Pete Zaitcev
f04b30e496 Clean up weird test code
While fixing something else, the strange code in the test suite
presented itself. Looks like a massive copy-paste error and a couple
of random oddities.

Change-Id: I191e8cd9299b9336b0600363780d2930a04d1fd5
2012-05-17 19:20:31 -06:00
gholt
1c3b75c291 Reverted the pulling out of various middleware:
RateLimit
StaticWeb
TempURL/FormPOST

Change-Id: I988e93e6f4aacb817a2e354d43a04e47516fdf88
2012-05-16 21:25:10 +00:00
Darrell Bishop
3d3ed34f44 Adding StatsD logging to Swift.
Documentation, including a list of metrics reported and their semantics,
is in the Admin Guide in a new section, "Reporting Metrics to StatsD".
An optional "metric prefix" may be configured which will be prepended to
every metric name sent to StatsD.

Here is the rationale for doing a deep integration like this versus only
sending metrics to StatsD in middleware.  It's the only way to report
some internal activities of Swift in a real-time manner. So to have one
way of reporting to StatsD and one place/style of configuration, even
some things (like, say, timing of PUT requests into the proxy-server)
which could be logged via middleware are consistently logged the same
way (deep integration via the logger delegate methods).

When log_statsd_host is configured, get_logger() injects a
swift.common.utils.StatsdClient object into the logger as
logger.statsd_client.  Then a set of delegate methods on LogAdapter
either pass through to the StatsdClient object or become no-ops. This
allows StatsD logging to look like:
    self.logger.increment('some.metric.here')
and do the right thing in all cases and with no messy conditional logic.

I wanted to use the pystatsd module for the StatsD client, but the
version on PyPi is lagging the git repo (and is missing both the prefix
functionality and timing_since() method).  So I wrote my
swift.common.utils.StatsdClient.  The interface is the same as
pystatsd.Client, but the code was written from scratch.  It's pretty
simple, and the tests I added cover it.  This also frees Swift from an
optional dependency on the pystatsd module, making this feature easier
to enable.

There's test coverage for the new code and all existing tests continue
to pass.

Refactored out _one_audit_pass() method in swift/account/auditor.py and
swift/container/auditor.py.

Fixed some misc. PEP8 violations.

Misc test cleanups and refactorings (particularly the way "fake logging"
is handled).

Change-Id: Ie968a9ae8771f59ee7591e2ae11999c44bfe33b2
2012-05-11 15:25:38 -07:00
Jenkins
86f37c47d7 Merge "Let some swift-ring-builder commands take >1 arg." 2012-05-11 15:15:03 +00:00
Victor Rodionov
a6595e22d1 SwiftException base class for all swift exceptions.
Also add new exception class SwiftConfigurationError,
that can't be used to indicate that swift parameters
in swift conf files are not correct.

Change-Id: I39bff9068a19c8e1c1b4aac38cb756c5e46d75e6
2012-05-10 17:02:35 -07:00
Jenkins
d76106724b Merge "have wsgi preauth copy over HTTP_HOST" 2012-05-10 16:12:32 +00:00
Jenkins
eba080a64c Merge "Speed up swift-get-nodes by 2x." 2012-05-10 16:09:23 +00:00
Jenkins
e51cdbc8ba Merge "Implement unit_test config to disable syslog." 2012-05-10 15:47:54 +00:00
Samuel Merritt
8e6f099daa Speed up swift-get-nodes by 2x.
It was loading the ring off disk once to print the primary nodes, and
then loading the whole thing off disk again to print the handoff
nodes. Changed it to only load the ring off disk once.

Change-Id: I6f4cd0af9762e1e69660c3eb20586590b5339e5f
2012-05-10 00:10:24 -07:00
David Goetz
20384f1f84 have wsgi preauth copy over HTTP_HOST
Change-Id: I1d9a6dcc6fcdad5cf99353eaf7eb69e703c38e22
2012-05-09 21:55:57 -07:00
Samuel Merritt
bb509dd863 As-unique-as-possible partition replica placement.
This commit introduces a new algorithm for assigning partition
replicas to devices. Basically, the ring builder organizes the devices
into tiers (first zone, then IP/port, then device ID). When placing a
replica, the ring builder looks for the emptiest device (biggest
parts_wanted) in the furthest-away tier.

In the case where zone-count >= replica-count, the new algorithm will
give the same results as the one it replaces. Thus, no migration is
needed.

In the case where zone-count < replica-count, the new algorithm
behaves differently from the old algorithm. The new algorithm will
distribute things evenly at each tier so that the replication is as
high-quality as possible, given the circumstances. The old algorithm
would just crash, so again, no migration is needed.

Handoffs have also been updated to use the new algorithm. When
generating handoff nodes, first the ring looks for nodes in other
zones, then other ips/ports, then any other drive. The first handoff
nodes (the ones in other zones) will be the same as before; this
commit just extends the list of handoff nodes.

The proxy server and replicators have been altered to avoid looking at
the ring's replica count directly. Previously, with a replica count of
C, RingData.get_nodes() and RingData.get_part_nodes() would return
lists of length C, so some other code used the replica count when it
needed the number of nodes. If two of a partition's replicas are on
the same device (e.g. with 3 replicas, 2 devices), then that
assumption is no longer true. Fortunately, all the proxy server and
replicators really needed was the number of nodes returned, which they
already had. (Bonus: now the only code that mentions replica_count
directly is in the ring and the ring builder.)

Change-Id: Iba2929edfc6ece89791890d0635d4763d821a3aa
2012-05-09 15:56:06 -07:00
Samuel Merritt
47f0dbb125 One PEP8 fix to make tox happy again.
Change-Id: I5ff2056f9f2eb99bfb98b020e3fc013332100e12
2012-05-09 12:28:00 -07:00
John Dickinson
b47bcf19e4 removed cname lookup middleware
The code has moved to https://github.com/notmyname/swift-cnamelookup.

For current users of cname lookup, this will require installing the new
package and changing the "use" line of the cname lookup conf section's
to:

[filter:cname_lookup]
use = egg:swift_cnamelookup#swift_cnamelookup

And then 'swift-init proxy reload'.

Change-Id: If622486ddb04a53251244c9840aa3cfe72168fc5
2012-05-09 14:00:51 -05:00
gholt
3f00c1a630 Pulled out Rate Limit middleware
Rate Limit middleware is now at
http://dpgoetz.github.com/swift-ratelimit/

For current users of Rate Limit, this will require installing the new
package and changing the "use" line of the ratelimit conf section to:

[filter:ratelimit]
use = egg:swiftratelimit#middleware

And then 'swift-init proxy reload'.

Change-Id: I2ab774e9cee9fba4103c1be4bea6d52d1adb29f7
2012-05-09 18:44:45 +00:00
John Dickinson
7dfbd785b0 removed domain remap middleware
The code has moved to https://github.com/notmyname/swift-domainremap.

For current users of domain remap, this will require installing the new
package and changing the "use" line of the domain remap conf section's
to:

[filter:domain_remap]
use = egg:swift_domainremap#swift_domainremap

And then 'swift-init proxy reload'.

Change-Id: I710caf9b991f9d37df36b826ae4338086d0ec36d
2012-05-08 21:30:35 -05:00
Jenkins
78d1c0ae42 Merge "fix pre_auth request funcs to handle quoted paths" 2012-05-09 01:48:58 +00:00
gholt
c0532a6ef2 Pulled out TempURL/FormPOST
TempURL/FormPOST is now at http://gholt.github.com/swift-tempurl/

For current users of TempURL/FormPOST, this will require installing the new
package and changing the "use" line of the tempurl and formpost conf section's
to:

[filter:tempurl]
use = egg:swifttempurl#tempurl

[filter:formpost]
use = egg:swifttempurl#formpost

And then 'swift-init proxy reload'.

Change-Id: I5bddf7f9e09ee07815530a41c46ff901fc21b447
2012-05-08 20:20:29 +00:00
Jenkins
8d2e7bd112 Merge "Pulled StaticWeb out to separate project" 2012-05-08 18:43:38 +00:00
Jenkins
e833a6c484 Merge "added annegentle entry in .mailmap" 2012-05-07 21:02:36 +00:00
David Goetz
a539ac56f0 fix pre_auth request funcs to handle quoted paths
Change-Id: I739e3f600cedab5c7174a5b1f0ff2ec6003fc453
2012-05-07 13:46:41 -07:00
John Dickinson
cc21288037 added annegentle entry in .mailmap
Change-Id: I9416d7e5ca155ce8b3258d4e18dd32917dc314a8
2012-05-07 15:15:28 -05:00
gholt
7dde909621 Pulled StaticWeb out to separate project
StaticWeb is now at http://gholt.github.com/swift-staticweb/

For current users of StaticWeb, this will require installing the new
package and changing the "use" line of the staticweb filter conf
section to:

use = egg:swiftstaticweb#middleware

And then 'swift-init proxy reload'.

Change-Id: Iab32adb5927698a667c5c6d6a572c44ca23414eb
2012-05-05 00:40:33 +00:00
Greg Lange
8d2fe89a7d Added an internal client.
Refactored object expirer to use this client.

Change-Id: Ibeca6dba873f8b4a558ecf3ba6e8d23d36f545b0
2012-05-04 18:07:54 +00:00
Jenkins
5dcc9083a7 Merge "Fixed inconsistent end_marker" 2012-05-04 17:37:06 +00:00
Jenkins
742f3d1a8e Merge "Make scripts in bin/ PEP8-compliant." 2012-05-04 17:33:32 +00:00
Jenkins
f7279fafea Merge "Fix related to bug #994502" 2012-05-04 16:22:38 +00:00
Samuel Merritt
2ccf219ec1 Make scripts in bin/ PEP8-compliant.
Also made tox's PEP8 check look at the scripts in bin/ to keep them
PEP8-compliant.

Change-Id: I710365ea929d7fc15578d5f742a236bad47ef28e
2012-05-04 08:24:51 -07:00
Brent Roskos
0d640971cd Fix related to bug #994502
Added support for configuring lock file location.
added an additional error handler.

Change-Id: I3635ed9694b9fb8526e0ca0591dc731da03a7128
2012-05-04 06:59:45 -04:00
gholt
f7c0f91da6 Added associated_projects.rst
In the interest of keeping the core Swift code repository less
complex, but still offering a quick way to find associated projects
that enhance or use Swift, I've added this new Associated Projects
page prominently to the Swift documentation.

This will allow much less barrier to entry on enhancing Swift as
other projects can work independently and will only need to wait on
the core Swift project for approval of minimal tweaks to the core
Swift code base.

It will also allow an easy central place to find cool associated
projects that otherwise might go unnoticed or even duplicated.

The plan is to move non-essential projects that are currently
embedded in the Swift repository out into their own projects with
links to them on this new page. This would include items such as
(just what I can think of right now): bin/swift command line tool and
clients, swift-bench, swift-dispersion, TempURL, FormPost, StaticWeb,
Rate Limiting, Swift3, Domain Remap, and CNAME Lookup.

After all that is done, those projects will be able to move forward
much more quickly and new developers for Swift itself will have much
less to learn and get confused about.

Change-Id: Ib8447d8bd480f0a3d8f0413137ccdba73a11dd91
2012-05-04 03:36:56 +00:00
Samuel Merritt
0befccccdf Let some swift-ring-builder commands take >1 arg.
`swift-ring-builder X.builder [add|set_weight|set_info|remove]` can
now work on multiple devices at once.

This allows for faster bulk operations; for example, if an
administrator has to add 48 new devices to the ring, then this lets
them do it in one command invocation. Since each invocation of
swift-ring-builder follows a deserialize-operate-serialize pattern,
using the bulk form of the commands on N devices will save N-1
[de]serializations.

Change-Id: Ibf77528f28026866af3c94d0370181c8013d5bc5
2012-05-03 17:45:33 -07:00
Jenkins
96476846b6 Merge "HTTP status value naming normalization" 2012-05-03 23:59:02 +00:00
Dan Dillinger
f7fdb9cf12 Implement unit_test config to disable syslog.
bug 701248
bug 819303

This change makes syslog optional, by providing a unit test
config with the ability to cause test/unit/__init__.py to
replace SysLogHandler with a fake logging class. The
default behavior is unchanged.

FakeLogger now inherits directly from Handler and mocks out
its API - this was a backward-compatibility issue.

Change-Id: I653dec148c4f6cf81759de03964c6a3290c1a290
2012-05-03 14:25:46 -04:00
gholt
e7d37b1a05 Fixed inconsistent end_marker
The listing of containers was inclusive whereas the listing of
objects was exclusive. I searched and searched and only found
end_marker usage with listings of objects so I changed the listings
of containers to match that.

Change-Id: Ia8eb66a7ceaef28c698e2d4e19dd5dfd9197a911
2012-05-03 00:25:31 +00:00
Tom Fifield
9920aeb7d4 bug 661267 adding config eastereggs, fixing defaults
Change-Id: I41356ee250c9088a2387b0d493586dd990a04ac3
2012-04-30 08:22:42 +10:00
Jenkins
e22ee457f0 Merge "Removed unused imports." 2012-04-27 14:34:55 +00:00
Jenkins
aa7a3a395e Merge "Fixed tabs in the multi-node doc." 2012-04-26 20:38:58 +00:00
Jenkins
097eb83c49 Merge "Restore the syntax -U tenant:user" 2012-04-26 20:37:46 +00:00
gholt
5f18d987a0 Fixed tabs in the multi-node doc.
Change-Id: Idf2ea227b0078026eb2693ff7c0a24ec926bb6f3
2012-04-26 20:29:08 +00:00
Jenkins
f5af3c4305 Merge "added docs and warnings about using SSL" 2012-04-26 20:18:07 +00:00
Jenkins
e48d01a7a7 Merge "return the full response from FakeAppObject" 2012-04-26 19:57:59 +00:00
Jenkins
a1910461a0 Merge "Added db_preallocation setting to replicators" 2012-04-26 17:56:02 +00:00
Pete Zaitcev
6b91352007 Restore the syntax -U tenant:user
On a relatively recent build of swift, all my scripts blew up with
"No tenant specified". It was caused by the fix to add --os_tenant_name,
commit ID:  208b8e85a80e46ddb49dc2035cb292570a20c7db

This patch restores the old behavior. I tested it to work with old
swauth-based Swift, new Keystone-based Swift, in the latter case using
both -U and --os_tenant_name arguments.

Note that this patch permits to use a literal colon in the user name
with the new syntax, as long as tenant is specified. Empty tenant
names are not allowed with either syntax.

Change-Id: I7785e6981a9d6281d0421c43875ee19d61d5ff43
Bug: 982909
2012-04-26 10:58:07 -06:00
Victor Rodionov
d2d0922707 HTTP status value naming normalization
Replace HTTP status code with constants like HTTP_OK, HTTP_NOT_FOUND, etc.

Change-Id: I76cd8bf880e7269454192a3bc4b027a297741247
2012-04-25 09:26:22 -07:00
Ionuț Arțăriși
92312f5631 remove unused imports and useless empty class Base
Change-Id: I78dbb390cf0afe03d4bcf1aa9ffc9497392579dd
2012-04-24 17:56:46 +02:00