Allow empty reseller prefixes in domain_remap

Change-Id: I2013e4686fce1c06626ec974f8d721721e6ca6e7
Remove fake _get_part and use the real thing

The get_part method is fast and stable given a consistent hash path
suffix/prefix, so there's no absolute requirement for the fake
implementation other than convenience.  OTOH, removing the fake
implementation and fixing the tests that were relying on it should make
it easier to write better tests going forward and harder to hide bugs
that don't show up when using the fakes.

There may be some overhead when writing new tests that use the ring if
you're making assertions on partitions or paths, but with a part power
of zero it's normally trivially obvious when a 1 needs to be a 0 or vice
versa.  Or you can just drop the assertions around the parts you were
faking anyway.

Change-Id: I8bfc388a04eff6491038991cdfd7686c9d961545
Multithread optimization for object updater

This change makes the object updater work the same
as the container updater, which is that it now
spawns one thread for each node that it needs to
update. This should help optimize its
performance/efficiency.

Change-Id: If740b8c67c0d953e4b510913bd8594570d868da6
Fix sporadic false failure in xprofile unit test code (master)

Same fix as is going through on feature/ec, fixed it there first
as it was happening often and no point in waiting until EC is
complete before getting it over to master...

Appears that what's been happening on feature/ec lately
with a middleware failure has to do with a hardcoded PID in
the test code itself causing a profile file to exist when
its not expected to by the test.

Test code used a PID of 135 and based on how get_logfiles()
is written, any real PID that starts with 135 will cause a
false failure in test_call().  This can be seen via inspection
and confirmed in logfiles where all captured assertions show
a profile filename beginning with 135.  Tried getting smarter
about choosing a fake PID (int) but then decided it was 100%
safe to use 'ABC' for this test since that'll never show up!

Change-Id: I958f1525c2727b3fb3f533242fa509fa8e59926c
Respect device weights when adding replicas

Previously, any new (partition, replica) pairs created by adding
replicas were spread evenly across the whole ring. Now it respects
device weights, so more (partition, replica) pairs are placed on
higher-weight devices.

Note that this only affects partition assignment *when the replica
count is increased*. Normal adding of disks without changing the
replica count is, and was, just fine.

The cause was that the devices' parts_wanted values weren't being
updated when the replica count went up. Since adding replicas makes
more things to assign, each device's desired share should have gone
up, but it didn't. This appears to be a simple oversight on the part
of the original author (me).

Change-Id: Idab14be90fab243c1077a584396a9981a4bd8638
Let admins add a region without melting their cluster

Prior to this commit, swift-ring-builder would place partitions on
devices by first going for maximal dispersion and breaking ties with
device weight. This commit flips the order so that device weight
trumps dispersion.

Note: if your ring can be balanced, you won't see a behavior
change. It's only when device weights and maximal-dispersion come into
conflict that this commit changes anything.

Example: a cluster with two regions. Region 1 has a combined weight of
1000, while region 2 has a combined weight of only 400. The ring has 3
replicas and 2^16 partitions.

Prior to this commit, the balance would look like so:

  Region 1: 2 * 2^16 partitions
  Region 2: 2^16 partitions

After this commit, the balance will be:

  Region 1: 10/14 * 2^16 partitions  (more than before)
  Region 2: 4/14 * 2^16 partitions  (fewer than before)

One consequence of this is that some partitions will not have a
replica in region 2, since it's not big enough to hold all of them.

This way, a cluster operator can add a new region to a single-region
cluster in a gradual fashion so as not to destroy their WAN link with
replication traffic. As device weights are increased in the second
region, more replicas will shift over to it. Once its weight is half
that of the first region's, every partition will have a replica there.

DocImpact

Change-Id: I945abcc4a2917bb12be554b640f7507dd23cd0da
Merge "Fix sporadic false failure in xprofile unit test code (master)"
Merge "Remove fake _get_part and use the real thing"
Merge "Respect device weights when adding replicas"
Merge "Let admins add a region without melting their cluster"
authors and changelog updates for 2.1.0 release

Change-Id: I457674f564dcacf0fd20004e9a3bb85113f53aa5
Merge "Multithread optimization for object updater"
Merge "authors and changelog updates for 2.1.0 release"
added Alex to AUTHORS

Change-Id: I2d147415e65c0f19159b995fc4eca78e075537b6
container merge_items speedup

I rewrote ContainerBroker.merge_items to use bulk SQL operations.  This
performs identical to the current version when len(item_list) == 1.  But as
item_list grows, the new version performs better, up to around 50% faster when
item_list numbers in the hundreds.

I wrote a quick script to stress test merge_items:
https://gist.github.com/redbo/12a4ed9c6a020aee39fe

Average of several runs against master: 35.08 seconds
Average of several runs against this branch: 18.44 seconds

Change-Id: I07fff1fb05c90f1411c79d961e0ed63264ed2acf
Merge "container merge_items speedup"
Merge "Allow empty reseller prefixes in domain_remap"
Only bind SAIO daemons to localhost

The SAIO configs have no default bind_ip setting configured
which causes them to listen on all available IP addresses.
This can be dangerous on a test machine with public interfaces,
especially with the default passwords set. Its reasonable to
choose a more restrictive setup, especially in SAIO which uses
127.0.0.1 throughout ring-builder, example commands and the
probe tests.

Change-Id: I471c49705ce09e07ec7acc07ee42a1e220529b82
Merge branch 'master' into rackspace_production
Combine acc/cont put_* methods and fix their lock problem.

The container backend is supposed to build a pending file and,
when it gets to a certain size, flush it all at once into the
sqlite db. Before this fix, many concurrent threads would ask
what the pending file size is to see if they should flush
instead of just appending to the pending file. The problem is
that many would ask, find it's too big, and try to get a lock.
The first one wins, flushes, but all the other waiting threads
still think they have to flush- which is a much slower opertaion
than just the append. This change gets the lock first and makes
sure that merge_items is only called when the pending file is full.

Change-Id: I29cfa13a48c8f7d16dd414b2288d50461adbafd2