Remove unused option from ObjectReplicator.__init__

disk_chunk_size is unused by the ObjectReplicator class. Note that it
*is* used by the object replicator process; it's just that
DiskFileManager is the one that pulls it out of the conf and pays
attention to it. Keeping it as an attribute on ObjectReplicator is
unnecessary.

Change-Id: I1eeef7b33873b4c8bb269ca02dcb067098b6fded
use get_container_info in ratelimit

Everyone else cooperates to store the container_info cache in the env the
first time it's requested.  This should save a duplicate memcache hit on
requests that ratelimiting looks at.

Change-Id: Ic6411d4619db6b53fafe9fdbf1d0a370d1258c38
updated hacking rules

1) Added comment for H231, which we were already enforcing. H231
is for Python 3.x compatible except statements.

2) Added check for H201, which we were enforcing in reviews
but waiting on hacking checks to be updated. H201 is for bare
except statements, and the update in upstream hacking is to
support the "  # noqa" flag on it.

The H201 check catches some existing bare excepts that are fixed.

Change-Id: I68638aa9ea925ef62f9035a426548c2c804911a8
Incorrect variable name in the diskfile.py

You should use the suffix variable instead of the hash_ variable when
updates the hashes dictionary in the get_hashes().

Fixes Bug1374777

Change-Id: If9a7ab5b6d271385e4fdc79ff9c216047a2f4d7e
Imported Translations from Transifex

Change-Id: I59b68ecb6f07e2b71e4655699d0165007d764718
Merge "Remove unused option from ObjectReplicator.__init__"
Merge "use get_container_info in ratelimit"
Merge "Incorrect variable name in the diskfile.py"
Limit partition movement when adding a new tier

When adding a new tier (region, zone, node, device) to an existing,
already balanced ring all existing partitions in the existing tiers of
the same level are gathered for reassigning, even when there is
not enough space in the new tier. This will create a lot of unnecessary
replication traffic in the backend network.

For example, when only one region exists in the ring and a new region is
added, all existing parts are selected to reassign, even when the new
region has a total weight of 0. Same for zones, nodes and devices.

This patch limits the number of partitions that are choosen to reassign
by checking for devices on other tiers that are asking for more
partitions.

Failed devices are not considered when applying the limit.

Co-Authored By: Florent Flament <florent.flament-ext@cloudwatt.com>
Change-Id: I6178452e47492da4677a8ffe4fb24917b5968cd9
Closes-Bug: 1367826
Some statements are evaluated twice in the setUp of the
TestObjectReplicator

Remove the duplicated statements.

Closes-Bug: #1374783

Change-Id: If2b55e864fea497d7a7b218adf11eb7749c27765
Merge "Some statements are evaluated twice in the setUp of the TestObjectReplicator"
fix a comment

Change-Id: I6310390f756bc0d326e56fceef32b630f0fe1ca1
Fix ring-builder crash.

If you adjust the replica count after adding devices but before the
first rebalance, the ring builder would crash.

To reproduce:

    $ swift-ring-builder crashy.builder create 8 3 1
    $ swift-ring-builder crashy.builder add r1z1-10.1.1.1:6000/sda1 1
    $ swift-ring-builder crashy.builder set_replicas 5
    $ swift-ring-builder crashy.builder rebalance

Change-Id: Id91cf8680961ccf6e3db153577e99cad545bee9d
Ensure sys.exit called in fork_child after exception

Currently, the fork_child() function in auditor.py does not
handle the case where run_audit() encounters an exception
properly.

A simple case is where the /srv directory is set
with permissions such that the 'swift' user cannot access it.
Such a situation causes a os.listdir() to return an OSError
exception.  When this happens the fork_child() process does not
run to completion and sys.exit() is not executed.  The process
that was forked off continues to run as a result.  Execution goes
back up to the audit_loop function which restarts the whole process.  The
end result is an increasing number of processes on the system
until the parent is terminated.  This can quickly exhaust the
process descriptors on a system.

This change wraps run_audit() in a try block and adds an
exception handler that prints what exception was encountered.
The sys.exit() was moved to a finally: block so that it will
always be run, avoiding the creation of zombies.

Change-Id: I89d7cd27112445893852e62df857c3d5262c27b3
Closes-bug: 1375348
Fix metadata overall limits bug

Currently metadata limits are checked on a per request basis. If
multiple requests are sent within the per request limits, it is
possible to exceed the overall limits.  This patch adds an overall
metadata check to ensure that multiple requests to add metadata to
an account/container will check overall limits before adding
the additional metadata.

Change-Id: Ib9401a4ee05a9cb737939541bd9b84e8dc239c70
Closes-Bug: 1365350
Merge "Ensure sys.exit called in fork_child after exception"
Merge "updated hacking rules"
Merge "Fix metadata overall limits bug"
Merge "Limit partition movement when adding a new tier"