swift/test/unit
Alistair Coles e7e5b87f8b db_file passed to broker should not affect it's sharding state
Previously if a ContainerBroker was constructed with
db_file=<hash>_shard.db then the broker would be in state 'SHARDED'
regardless of the presence of a <hash>.db file or not.

This seems like a bad thing, and manifests as a bug when we pass a
sharding container's db_file to the _replicate_object method. The
db_file is <hash>_shard.db (because the container is sharding). The
_replicate_object method uses this to construct a broker instance
which erroneously takes on state sharded.

If _replicate_object ends up using rsync then in _rsync_db it calls
broker.get_brokers() in order to build a list of db files to be
rsync'd, but get_brokers() only returns one broker (for the shard db)
because the broker thinks it is in state sharded. Consequently only
the shard db is rsync'd whereas both dbs should be rsync'd.

This patch decouples the sharding state from the db file passed
to the broker __init__.

Change-Id: Id63d967277ec1634008cc9ce13cefd731836e02c
2017-10-25 11:28:26 -07:00
..
account Merge branch 'master' into merge-from-master 2017-09-20 15:55:58 -07:00
cli Change ShardRange to take a created_at arg 2017-10-17 21:11:54 +00:00
common Change ShardRange to take a created_at arg 2017-10-17 21:11:54 +00:00
container db_file passed to broker should not affect it's sharding state 2017-10-25 11:28:26 -07:00
obj Merge branch 'master' into feature/deep 2017-10-13 18:04:17 +00:00
proxy Include a shard's account in its name 2017-10-16 19:26:30 +01:00
test_locale monkeypatch thread for keystoneclient 2015-11-03 16:36:19 +01:00
__init__.py Always require device dir for containers 2017-09-01 10:32:12 -07:00
helpers.py Move listing formatting out to proxy middleware 2017-09-15 06:38:26 +00:00