Managed sequences in Postgres Pro Shardman are implemented on top of regular PostgreSQL sequences with some additional cluster-wide metadata, which among other things holds the interval of cluster-wide unused sequence elements.
When CREATE SEQUENCE .. WITH (global) is issued, an ordinary
PostgreSQL sequence with the same
name is created on every cluster node. The range of this unmanaged
sequence is a bounded sub-interval of the managed sequence (as
defined by MINVALUE and
MAXVALUE parameters), and it contains at most
block_size elements. The
nextval function returns
values from the unmanaged sequence until it runs out, then a new
sub-interval with block_size elements is
allocated from the managed sequence using a broadcast query
involving all cluster nodes. So, smaller block size values
make the generated numbers more monotonic across the cluster,
but incur a performance penalty since the broadcast query may
be rather expensive. Another way to describe the block size
parameter is to say that it controls the size of the second
cache level, similarly to how the CACHE
parameter works, except at the level of an entire
Postgres Pro Shardman cluster.
Also note, that every time a new sub-interval is allocated the
underlying unmanaged sequence is modified (as in ALTER
SEQUENCE), which will lock it for the transaction
duration, preventing any other local concurrent transactions
from obtaining next sequence values.