Files
Alistair Coles
001d931e6a
sharder: update own_sr stats explicitly
Previously, when fetching a shard range from a container DB using ContainerBroker.get_own_shard_range(), the stats of the returned shard range were updated as a side effect. However, the stats were not persisted in the own shard range row in the DB. Often the extra DB queries to get the stats are unnecessary because we don't need up-to-date stats in the returned shard range. The behavior also leads to potential confusion because the object stats of the returned shard range object are not necessarily consistent with the object stats of the same shard range in the DB. This patch therefore removes the stats updating behavior from get_own_shard_range() and makes the stats updating happen as an explicit separate operation, when needed. This is also more consistent with how the tombstone count is updated. Up-to-date own shard range stats are persisted when a container is first enabled for sharding, and then each time a shard container reports its stats to the root container. Change-Id: Ib10ef918c8983ca006a3740db8cfd07df2dfecf7