You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How the the indices and the concept of checkPointId fit sharding of the «commits» collection?
Let’s say I shard on bucketId+streamId for instance (they seem to be prefixes for the unique indices), I guess each shard could accept duplicate checkpointIds?
MongoDB's sharded unique-index rules require the shard-key prefix for non-_id unique indexes; when _id is not the shard key its uniqueness is only enforced per shard. Consequently, max-plus-one allocation and retry-on-duplicate cannot simply be assumed to provide the existing global checkpoint uniqueness/order contract across shards.
A supportable design needs to specify:
Global versus bucket-local checkpoint ordering and uniqueness.
A shard key compatible with every required uniqueness constraint.
Concurrent writers, global scans, migration/resharding and recycled-stream routing. Deletion rewrites BucketId to :rb, so a BucketId-based shard key also needs explicit treatment.
Topology-backed tests showing no checkpoint collisions or missed polling results.
The new validation used one standalone MongoDB 7.0.45 instance, not a sharded cluster, so it does not validate sharding. The independent cross-bucket recycling defect is now tracked in #87; fixing it alone would not establish sharding support.
Co-authored by Alessandro Giorgetti and Codex (OpenAI).
Tracking this as a deferred design/implementation follow-up to #118. Replica-set support with an unsharded Commits collection is required for #118 and is not blocked by this issue. This issue concerns actually sharding the Commits collection, not merely connecting through mongos.
The current schema relies on globally unique checkpoint _id values and unique stream/commit keys that start with BucketId. With a bucket-prefixed shard key, _id alone may be unique only per shard; choosing _id as shard key conflicts with the existing stream uniqueness indexes. MongoDB's unique index rules.
A future implementation must preserve both stream concurrency and cross-bucket polling correctness across shards. Cover concurrent writes to different shards, delayed visibility, saved-checkpoint resume, failover, recycling/cleanup, and migration from existing storage; do not assume globally unique IDs alone also guarantee safe visibility order.
Co-authored by Alessandro Giorgetti and Codex (OpenAI).
Activity
AGiorgetti commentedon Oct 23, 2026
Review update against 286c0ae (rechecked 2026-10-23).
This remains a design/support gap rather than a configuration-only question.
The current indexes do not all have
{BucketId, StreamId}as a prefix: the unique checkpoint index begins{BucketId, CheckpointNumber}. Also, CheckpointNumber is the BSON_id.MongoDB's sharded unique-index rules require the shard-key prefix for non-
_idunique indexes; when_idis not the shard key its uniqueness is only enforced per shard. Consequently, max-plus-one allocation and retry-on-duplicate cannot simply be assumed to provide the existing global checkpoint uniqueness/order contract across shards.A supportable design needs to specify:
:rb, so a BucketId-based shard key also needs explicit treatment.The new validation used one standalone MongoDB 7.0.45 instance, not a sharded cluster, so it does not validate sharding. The independent cross-bucket recycling defect is now tracked in #87; fixing it alone would not establish sharding support.
Co-authored by Alessandro Giorgetti and Codex (OpenAI).
AGiorgetti commentedon Dec 2, 2026
Tracking this as a deferred design/implementation follow-up to #118. Replica-set support with an unsharded
Commitscollection is required for #118 and is not blocked by this issue. This issue concerns actually sharding theCommitscollection, not merely connecting throughmongos.The current schema relies on globally unique checkpoint
_idvalues and unique stream/commit keys that start withBucketId. With a bucket-prefixed shard key,_idalone may be unique only per shard; choosing_idas shard key conflicts with the existing stream uniqueness indexes. MongoDB's unique index rules.A future implementation must preserve both stream concurrency and cross-bucket polling correctness across shards. Cover concurrent writes to different shards, delayed visibility, saved-checkpoint resume, failover, recycling/cleanup, and migration from existing storage; do not assume globally unique IDs alone also guarantee safe visibility order.
Co-authored by Alessandro Giorgetti and Codex (OpenAI).