ShuffleShardExpectedInstancesPerZone returns the number of instances that should be selected for each zone when zone-aware replication is enabled. The algorithm expects the shard size to be divisible by the number of zones, in order to have nodes balanced across zones. If it's not, we do round up.
(shardSize, numZones int)
| 39 | // zone when zone-aware replication is enabled. The algorithm expects the shard size to be divisible |
| 40 | // by the number of zones, in order to have nodes balanced across zones. If it's not, we do round up. |
| 41 | func ShuffleShardExpectedInstancesPerZone(shardSize, numZones int) int { |
| 42 | return int(math.Ceil(float64(shardSize) / float64(numZones))) |
| 43 | } |
| 44 | |
| 45 | // ShuffleShardExpectedInstances returns the total number of instances that should be selected for a given |
| 46 | // tenant. If zone-aware replication is disabled, the input numZones should be 1. |
no outgoing calls