swift/test/unit/container
Tim Burke a4cf508a38 Identify deleted shards as shards
When a DB gets deleted, we clear out its metadata. This included sysmeta
such as that used to tell shards the name of their root DB.

Previously, this would cause deleted shards to pop back to life as roots
that claimed to have objects still sitting in whatever container they
sharnk into.

Now, use the metadata if it's available, but when it's not, go by the
state of the DB's "own shard range" -- deleted shards should be marked
deleted, while roots never are.

This allows us to actually clean up the database files; you can test
this by doing something like

 * Run `nosetests test/probe/test_sharder.py:TestContainerSharding.test_shrinking`
 * Run `find /srv/*/*/containers -name '*.db'` to see how many databases
   are left on disk. There should be 15: 3 for the root container, 6 for
   the two shards on the first pass, and another 6 for the two shards on
   the second pass.
 * Edit container configs to decrease reclaim_age -- even 1 should be
   fine.
 * Run `swift-init main start` to restart the servers.
 * Run `swift-init container-sharder once` to have the shards get marked
   deleted.
 * Run `swift-init container-updater once` to ensure all containers have
   reported.
 * Run `swift-init container-replicator once` to clean up the
   containers.
 * Run `find /srv/*/*/containers -name '*.db'` again to verify no
   containers remain on disk.

Change-Id: Icba98f1c9e17e8ade3f0e1b9a23360cf5ab8c86b
2020-07-07 16:06:28 -07:00
..
__init__.py Initial commit of Swift code 2010-07-12 17:03:45 -05:00
test_auditor.py Pass logger instances to AccountBroker/ContainerBroker 2019-05-03 01:15:20 +09:00
test_backend.py Identify deleted shards as shards 2020-07-07 16:06:28 -07:00
test_reconciler.py Make FakeSwift query param order agnostic 2020-01-06 16:27:06 -06:00
test_replicator.py sharding: Better-handle newlines in container names 2020-01-03 16:04:57 -08:00
test_server.py Don't auto-create shard containers 2020-06-03 13:26:31 -07:00
test_sharder.py Latch shard-stat reporting 2020-05-29 22:33:10 -07:00
test_sync_store.py Cleanup test tempdirs in tearDown 2017-09-01 15:34:30 +01:00
test_sync.py Stop retrying every deletes in container-sync 2020-01-20 22:06:44 -08:00
test_updater.py pep8: Turn on E305 2020-04-03 21:22:38 +02:00