Allow for multiple X-(Account|Container)-* headers.

When the number of account/container or container/object replicas are
different, Swift had a few misbehaviors. This commit fixes them.

* On an object PUT/POST/DELETE, if there were 3 object replicas and
  only 2 container replicas, then only 2 requests would be made to
  object servers. Now, 3 requests will be made, but the third won't
  have any X-Container-* headers in it.

* On an object PUT/POST/DELETE, if there were 3 object replicas and 4
  container replicas, then only 3/4 container servers would receive
  immediate updates; the fourth would be ignored. Now one of the
  object servers will receive multiple (comma-separated) values in the
  X-Container-* headers and it will attempt to contact both of them.

  One side effect is that multiple async_pendings may be written for
  updates to the same object. They'll have differing timestamps,
  though, so all but the newest will be deleted unread. To trigger
  this behavior, you have to have more container replicas than object
  replicas, 2 or more of the container servers must be down, and the
  headers sent to one object server must reference 2 or more down
  container servers; it's unlikely enough and the consequences are so
  minor that it didn't seem worth fixing.

The situation with account/containers is analogous, only without the
async_pendings.

Change-Id: I98bc2de93fb6b2346d6de1d764213d7563653e8d
Merge "get swob.Request.blank to parse path"
authors and changelog update for swift 1.7.6

Change-Id: Iad00e51fb17c9e829bd5ba7b56a0d24253cfe8b2
version bump to 1.7.7-dev

I expect the next release to actually be 1.8, but to prevent issues
if we decide to release 1.7.7, I'm only moving the rev number.

Change-Id: Ia9e05c5f036b8fbf67972470f240e84f7595223a
Merge "version bump to 1.7.7-dev"
Make statsd sample rate behave better.

As Dieter pointed out in bug 1090495
(https://bugs.launchpad.net/swift/+bug/1090495), the volume of metrics
can vary wildly between StatsD metrics.

This patch implements a partial solution by reducing the sample_rate
used for known high-volume metrics (operational experience will need to
inform this over time) and introducing a new tunable,
log_statsd_sample_rate_factor which is multiplied by the sample_rate for
every statsd stat.  This tunable can be used to reduce StatsD traffic
proportionally for all metrics and is intended to replace
log_statsd_default_sample_rate, which is left alone for
backward-compatibility, should anyone be using it.

This patch also includes a drive-by fix for log_udp_port which wasn't
being converted to an int (I didn't verify that actually causes trouble
in SysLogHandler(), but it's definitely an improvement regardles).

Change-Id: Id404636e3629f6431cf1c4e64a143959750a3c23
Add --run-dir switch to swift-init

- Add ability to specify an alternative run_dir than the default
  /var/run/swift.
- DocImpact

Change-Id: I17677588f2c8da563b7fec2dc4fdc52da87126ed
Merge "Add --run-dir switch to swift-init"
Fix superfluous GET requests in swift-bench.

If you specified num_gets = 0 for a benchmarking run (say, if you're
benchmarking PUT rate), you'd still get each swift-bench-client
process doing 1 GET request. Now you don't.

This should also fix the case where you've got more objects than
swift-bench-client processes, for example when you're uploading a few
large objects and then doing lots of parallel GETs of those
objects. Now you'll get the number requested, not
max(number-requested, number-of-bench-clients).

Change-Id: Ied9eb733dd9af51a3c6af8b815ad6cff0ff746b7
prevent irregular auth_prefix config in tempauth

Tempauth handles a authorization request by request path.
If a request's path start with auth_prefix, tempauth middleware
handles that request to authorization method.
Therefore, when configuring auth_prefix to '/', all requests
handle to authorization method.

This change enables tempauth to prevent invalid auth_prefix
config '/' and similar empty auth_prefix in initialization method.

Fixes bug #1096538.

Change-Id: I20b157e2a0809c17409fc65a8eff0858fe4aff29
Merge "prevent irregular auth_prefix config in tempauth"
Update auto-generated docs

Removed sidebar with broken (static) links referencing out-of-date docs.

Added an external link to the Swift API docs

fixes bug #1025099

Change-Id: I7f3106175b84b1063f74aa6c5693ab1e422cdb59
Fixed bug in domain_remap and cname_lookup middleware

If domain_remap and cname_lookup received request which has no host header,
then returns 500 error. This fixes that problem.

Change-Id: Ibb457e9b4cb21181d8243858c04ce255365690da
Fixes: bug #1100632
Add more command-line options to swift-bench.

These settings:
  1. are already exposed via config file
  2. were not exposed as command-line options, and
  3. are things I wanted on the command line while benchmarking recently.

I didn't include short options for --(get|put|delete)-concurrency
since I couldn't think of good single-letter ones, and optparse won't
take "-gc", "-pc", or "-dc".

Change-Id: I0bd7c7ae2892244eed37b8c10c9357dc7e1190d3
Validate numericness of ports in builder files.

You can't really goof this up using bin/swift-ring-builder, but if you
have code that uses swift.common.ring.RingBuilder directly, you can
stuff e.g. "6002" in where you mean 6002, resulting in some fairly
baffling failures. (Yes, I have done this.)

Change-Id: I87b7b7066b9ea2ce6f82255605da99cf0d283689
Merge "Update auto-generated docs"
Merge "Add more command-line options to swift-bench."
Add handler for CORS "actual requests"

Fix for bug 1095130

* Added a wrapper function around public methods to handle
  CORS actual requests. These requests need to return some
  extra headers to be valid responses to a CORS request.
  Access-Control-Expose-Headers and Access-Control-Allow-Origin.

* Added support for the CORS header Access-Control-Expose-Headers.

* Some refactoring of the OPTIONS method so the
  "is_origin_allowed" logic can be reused.

* Added a little extra detail to the CORS documentation.

DocImpact

Change-Id: I68538e472a900775427f21a8a59e738a83dcc8bc
Merge "Add handler for CORS "actual requests""
Merge "Allow for multiple X-(Account|Container)-* headers."