swift/test/unit/account
Alistair Coles bcecddd517 Consider tombstone count before shrinking a shard
Previously a shard might be shrunk if its object_count was fell below
the shrink_threshold. However, it is possible that a shard with few
objects has a large number of tombstones, which would result in a
larger than anticipated replication of rows to the acceptor shard.

With this patch, a shard's row count (i.e. the sum of tombstones and
objects) must be below the shrink_threshold before the shard will be
considered for shrinking.

A number of changes are made to enable tombstone count to be used in
shrinking decisions:

 - DatabaseBroker reclaim is enhanced to count remaining tombstones
   after rows have been reclaimed. A new TombstoneReclaimer class is
   added to encapsulate the reclaim process and tombstone count.
 - ShardRange has new 'tombstones' and 'row_count' attributes.
 - A 'tombstones' column is added to the Containerbroker shard_range
   table.
 - The sharder performs a reclaim prior to reporting shard container
   stats to the root container so that the tombstone count can be
   included.
 - The sharder uses 'row_count' rather than 'object_count' when
   evaluating if a shard range is a shrink candidate.

Change-Id: I41b86c19c243220b7f1c01c6ecee52835de972b6
2021-05-07 18:41:18 +01:00
..
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
test_auditor.py Cleanup tests' import of debug_logger 2021-04-27 12:04:41 +01:00
test_backend.py Consider tombstone count before shrinking a shard 2021-05-07 18:41:18 +01:00
test_reaper.py Cleanup tests' import of debug_logger 2021-04-27 12:04:41 +01:00
test_replicator.py Make db_replicator usync smaller containers 2015-10-19 15:26:12 +01:00
test_server.py Cleanup tests' import of debug_logger 2021-04-27 12:04:41 +01:00
test_utils.py Allow internal clients to use reserved namespace 2019-11-27 11:22:00 -06:00