Open
Description
Each replicasets should have unique "replicaset number" generated by some sort of a global sequence. A case when this would be useful is a need to generate sequence offsets for a sharded space when each replicaset in the cluster must have a non-overlapping sequence range.
For example
-- vshard.my_replicaset_number() returns current replicaset number
-- replicaset #0:
IDS_PER_RS = 10^12
min = vshard.my_replicaset_number() * IDS_PER_RS -- 0
start = min -- 0
max = vshard.my_replicaset_number() * IDS_PER_RS + IDS_PER_RS -1 -- 10^12 -1
box.schema.sequence.create('seq', {min=min, start=start, max=max)
-- replicaset #1:
-- min = 10^12
-- max = 2 * 10^12 - 1