container-sharder should keep cleaving when there are no rows
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Matthew Oliver |
Bug Description
Suppose you've got a sharding or sharded container. It's pretty overloaded (that's why we enabled sharding!), so if a client issues a container PUT before uploading objects (such as python-swiftclient does), it's entirely reasonable that we may create some new, empty DBs on handoffs. (Side note, this was also a decent mitigation for https:/
That's mostly OK -- the replicator will get all of the sharding state loaded into the new guy; from there:
- handoff stops confusing the proxy into thinking the container's unsharded
- handoff can even respond to proxy requests for shard ranges!
- sharder will work through cleaving the shard ranges on the handoff,
eventually moving the DB from sharding to sharded
- once sharded, the replicator finally cleans up the handoff.
But... for very large root containers (think hundreds or even a thousand shard ranges!), this process can take a *long* time since we only handle cleave_batch_size shards per cycle. We don't really want to crank that up -- we still want to make steady progress across all sharding containers instead of chewing on one for a long time before ever looking at the next one.
At the same time, we should recognize that not all DBs represent the same amount of work to shard: we probably *could* work through the entirety of that empty DB in the same amount of time that it takes us to cleave a million rows from a full one.
To put some numbers on the problem: I've seen an empty DB with 682 ranges done, 822 to go. Surely in part because of needing to send stats for 1500 shards (see also: https:/
I have almost finished the first version of a patch to address this.