345 Commits

Author SHA1 Message Date
John Dickinson
46f26b3034 added GoLang binding and CDMI to associated projects
Change-Id: I720a0e0e886d25eec52556e8ce93bf9c49f6b452
2012-11-27 09:49:56 -08: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
Chmouel Boudjnah
101f566e92 Updating doc reflecting the move of auth_token.
The auth_token middleware has moved, updating the doc.

Change-Id: I8133b876a53d61bf94169cf08c8b1fa6bbf9681a
2012-11-16 12:30:28 +10:00
Jenkins
e9a41ed550 Merge "Remove outdated Debian packaging guide." 2012-11-15 22:15:55 +00:00
Jenkins
6b8f966364 Merge "Better TempAuth storage URL guessing" 2012-11-14 21:10:18 +00:00
Samuel Merritt
bf90ba2de1 Remove outdated Debian packaging guide.
There are 3 sections in there, all useless.

Section 1 tells you how to install Swift packages from the swift-core
PPA. However, the latest version there is ancient.

Section 2 tells you how to build your own Swift packages. However, it
talks about getting the source code from the "debian" branch in bzr,
which is obviously really old.

Section 3 tells you how to take the packages from section 2 and
install them. This isn't too out-of-date, but since section 2 doesn't
work any more, section 3 is useless.

Since stale docs are worse than no docs, there's no current
information in this document, and bringing it up-to-date requires a
whole pile of work, I've chosen to delete it entirely.

Also pulled out a couple references to the PPA elsewhere.

Fixes bug 917385.
Fixes bug 1026145.

Change-Id: I510bd8619531fe110419e5488bd20d3602868d66
2012-11-13 13:06:48 -08:00
Yee
53ab2e150d fix bug1039861, remove license header in doc/source/conf.py.
Change-Id: Iab43ac342faf3722ccab1ed034f08752dbbfaae1
2012-11-11 00:15:39 -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
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
Florian Hines
de09cbe6f4 Extended documentation for using custom loggers
Change-Id: I78a5c109c9440df752e390698502f57d4392fb67
2012-10-26 17:59:42 -05:00
Jenkins
1c05d62bed Merge "Adding CORS support" 2012-10-25 02:23:57 +00:00
Scott Simpson
74b27d504d Adding CORS support
Change-Id: I894473994cdfea0996ad16e7619aff421f604abc
2012-10-23 14:48:59 -05:00
Samuel Merritt
851bbe2ea9 Track unlinks of async_pendings.
It's not sufficient to just look at swift.object-updater.successes to
see the async_pending unlink rate. There are two different spots where
unlinks happen: one when an async_pending has been successfully
processed, and another when the updater notices multiple
async_pendings for the same object. Both events are now tracked under
the same name: swift.object-updater.unlinks.

FakeLogger has now sprouted a couple of convenience methods for
testing logged metrics.

Fixed pep8 1.3.3's complaints in the files this diff touches.

Also: bonus speling and, grammar fixes in the admin guide.

Change-Id: I8c1493784adbe24ba2b5512615e87669b3d94505
2012-10-23 10:27:21 -07: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
Michael Barton
c7e2e9a1f3 remove configobj from deps
Change-Id: Ie566e712ba0d3dca543e99efbdb576b19623e73c
2012-10-08 14:20:00 -07:00
Jenkins
026846c7b5 Merge "local WSGI Request and Response classes" 2012-10-03 20:49:05 +00: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
David Goetz
a6c44d2764 allow replicator run_once to check specific devices/partitions
Change-Id: If45f77fda269ae6e251579542e70eb71bd11fe2a
2012-09-28 12:24:15 -07:00
John Dickinson
343968b2d3 added disable_fallocate info to docs
Change-Id: I8130e258d77f47bfa28ecf79a51a6e34671ada22
2012-09-12 11:15:25 -07: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
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
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
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
Darrell Bishop
56bb00f7c9 A couple minor tweaks to the SAIO guide.
Added "-p" to mkdir cmds in a "set -e" script (/etc/rc.local).

/var/log/swift gets owned by the group "adm", but isn't group writeable
by default, so the find/rm in "resetswift" fails.  So I added a chmod to
add group-write for that directory tree.

Added commands for installing tox.

Change-Id: Ic141491272a83a9233cd6a6a70c3ef74411f3f51
2012-08-21 16:18:51 -07:00
Darrell Bishop
af2ff124eb Update docs for new ring serialization.
The Admin Guide now contains information about the ring serialization
change (and importantly, how to downgrade, if necessary).

Also added container-server conf var, "allow_versions" to the Deployment
Guide.

Also changed description of proxy-server conf var,
"max_containers_whitelist" to say it contains "account names" not
"account hashes".

Change-Id: Ib23c6118cc5195cc04765afd28e442e4c735f0d4
2012-08-21 12:09:28 -07:00
John Dickinson
3c82151c44 update object versions docs
Change-Id: I00bf2e20c2683d0440ca425461e0ab87197ee720
2012-08-07 16:26:38 -07:00
Tong Li
d8c5c0c897 all in one setup rc.local needs -p for mkdir command
bug fixes for swift 1033089
Swift 1.6.0 All in One setup uses rc.local to create a set of
directories like the following:
   /var/cache/swift /var/cache/swift2 /var/cache/swift3
   /var/cache/swift4
   /var/run/swift
without -p for mkdir command, when some of these directories
already exist, the rc.local fails so that the next set of
command won't execute. This causes swift fail to start because
of /var/run/swift does not exist. Adding -p to both mkdir
command solves this problem.

Change-Id: Ia26c9a857723747008293c0631c9acc1b58eca7e
2012-08-06 09:11:07 -04:00
gholt
a1a4d35362 Logging improvements: handoffs and thread locals
A warning log line is emitted whenever the proxy has to use a handoff
node. Monitoring these warnings can indicate a problem within your
cluster; however, you can disable these log lines by setting the
proxy conf's log_handoffs to false.

While working on this, I also noticed why many proxy log lines did
not have txn_id and client_ip -- subcoroutines. Now the logger thread
locals are copied to the subcoroutines.

Change-Id: Ibac086e1b985f566c068d083620287509de35da8
2012-07-30 00:50:13 +00:00
Florian Hines
0da1b4f82d Create and configure /var/cache/swift in SAIO
Fixes bug #1024477

Change-Id: Id09bbff6bb4a5d032727d3ca53b3276b4769d178
2012-07-23 16:44:06 -05:00
Jenkins
a9887c0e15 Merge "Move swift_auth middleware from keystone to swift." 2012-07-20 17:30:01 +00:00
Florian Hines
5f72a8db4a Fix Dispersion report and swift-bench on saio
We're still using saio:11000 in a few spots so a few things
don't work out of the box on the saio. Fixes bug #1024561

Change-Id: I226de54c2785b0d0b681c8d0cc24260adbd3d663
2012-07-13 17:48:37 -05:00
Chmouel Boudjnah
afa4f70024 Move swift_auth middleware from keystone to swift.
- Rename it to keystoneauth for consistenties.
- Implements blueprint keystone-middleware.

Change-Id: I208fecdf3ee991694b4239f065032324d297fd35
2012-07-05 14:36:14 -04:00
Jenkins
cc73f5cbe0 Merge "Added config options for rate limiting of large object downloads." 2012-06-20 18:12:48 +00:00
Jenkins
c0e7c38c9f Merge "Make object server's caching more configurable." 2012-06-12 11:01:16 +00:00
Samuel Merritt
28cd9b2da8 Make object server's caching more configurable.
The object server had a constant KEEP_CACHE_SIZE = 5*1024*1024;
unauthenticated GET requests for files smaller than KEEP_CACHE_SIZE
would not evict the file from the kernel's buffer cache after it was
read from disk.

Now that hardcoded constant is a configuration parameter
("keep_cache_size"), and now there is also another parameter called
"keep_cache_private". If set, then both authenticated and
unauthenticated GET requests for small files will not evict the data
from the buffer cache. The default values are 5 MiB and False,
respectively, so the default behavior is the same.

Bonus: the "mb_per_sync" parameter is now documented in the deployment
guide.

Change-Id: I9a11dbe861f4c23535c6aa82a9111a6fe2db2a59
2012-06-07 17:12:11 -07:00
Greg Lange
6987d222de Added config options for rate limiting of large object downloads.
bug 786197

Change-Id: Idd73986ca4550b20dff340df4acd12f3bfc01075
2012-06-07 20:19:31 +00:00
Chmouel Boudjnah
22572b506a Remove swift.common.client from here.
- It has been to its own gerrit project.
- direct_client should follow next.
- Implements blueprint clientbindings.

Change-Id: I3bb50c95eba81302bfec71cb7ce5288b85a41dc0
2012-06-07 16:36:49 +02:00
John Dickinson
d668b27c09 fixed doc table format
Change-Id: I319de933ecfb1e3853e3064656968c36980ce5f5
2012-05-28 13:36:59 -05:00
Jenkins
676c338b7c Merge "Expand recon middleware support" 2012-05-25 05:12:35 +00:00
Michael Barton
7c98e7a625 Move proxy server logging to middleware.
Change-Id: I771c87207d4e1821e32c3424b341d182cc7ea7c0
2012-05-24 21:15:51 -07:00
Florian Hines
ccb6334c17 Expand recon middleware support
Expand recon middleware to include support for account and container
servers in addition to the existing object servers. Also add support
for retrieving recent information from auditors, replicators, and
updaters. In the case of certain checks (such as container auditors)
the stats returned are only for the most recent path processed.

The middleware has also been refactored and should now also handle
errors better in cases where stats are unavailable.

While new check's have been added the output from pre-existing
check's has not changed. This should allow existing 3rd party
utilities such as the Swift ZenPack to continue to function.

Change-Id: Ib9893a77b9b8a2f03179f2a73639bc4a6e264df7
2012-05-24 14:50:00 -05:00
Jenkins
a74cd3b01b Merge "Remove swift3 from here." 2012-05-24 15:30:17 +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
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