swift-manage-shard-ranges should refuse to find ranges in an already-sharded DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
New
|
Undecided
|
Unassigned |
Bug Description
So I've already got a sharded DB; it's got some 800+ objects, split across shards with 250, 250, 300+ objs:
vagrant@
Loaded db broker for AUTH_test/c
Sharding enabled = True
Own shard range: {
...
"name": "AUTH_test/c",
"object_count": 847,
...
}
db_state = sharded
Metadata:
...
vagrant@
Loaded db broker for AUTH_test/c
Existing shard ranges:
[
{
...
"lower": "",
"object_count": 250,
"upper": "swift/
},
{
...
"lower": "swift/
"object_count": 250,
"upper": "swift/
},
{
...
"lower": "swift/
"object_count": 347,
"upper": ""
}
]
... but if I forget that I've already found shard ranges and go to find a fresh set...
vagrant@
Loaded db broker for AUTH_test/c
Namespace(
[
{
"index": 0,
"lower": "",
"object_count": 847,
"upper": ""
}
]
Found 1 ranges in 0.00190997s (total object count 847)
... it "helpfully" offers to throw everything back into a single shard that's way more than the rows-per-shard I specified. I'm guessing it just went ahead and tried to find splits on the records in the actual objects table (which was empty).
Seems better for us to bail when we see that the DB's sharded (so we don't expect it to actually have any object rows).