PCSM-283 Skip sharding operations for replica set - #67
rasika-chivate wants to merge 54 commits into
Conversation
Co-authored-by: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Version guidance, URI syntax, migration prerequisites, and workflow instructions contain unresolved inaccuracies.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
Suppressed comments (5)
docs/sharding.md:17
- This sentence applies “different numbers of shards” to both target topologies, but a replica set has no shards. Limit that statement to the sharded-target case so the topology description remains accurate.
In both cases, the source must be a sharded MongoDB deployment. The source and target can have different numbers of shards, and a replica set target does not require a target `mongos` instance.
docs/sharded-source-to-replica-set-target.md:41
- The examples are not in one code block, and the stray backtick in
target-userbreaks the target username and Markdown rendering. Present both complete environment assignments in a fenced block withtarget-user` intact.
`PCSM_SOURCE_URI="mongodb://source-user:password@mongos-source:27017/admin"`
PCSM_TARGET_URI="mongodb://target-`user:password@target1:27017,target2:27017,target3:27017/admin?replicaSet=rs0"`
docs/sharded-source-to-replica-set-target.md:53
- The singular noun after “the other” is missing an article. This also switches from the page's established “target” terminology to “destination”; use a parallel source/target description.
1. Create two clusters, one sharded (source) and the other replica set (destination).
docs/sharded-source-to-replica-set-target.md:92
- These commands are described as running only on the target, so their output cannot establish that counts match the source. Instruct readers to run the same queries against both deployments before comparing the results.
6. Confirm that both collections are present on the target and that document counts match:
docs/sharded-source-to-replica-set-target.md:107
- Finalization can still be in progress when the first status request runs (
docs/install/usage.md:171-175), so one immediate check is not guaranteed to produce the shownfinalizedresponse. Tell readers to poll until that state is reached.
8. Check the status again:
- Files reviewed: 4/4 changed files
- Comments generated: 3
- Review effort level: Balanced
…ttps://github.com/percona/pcsm-docs into PCSM-283-Skip-sharding-operations-for-replica-set
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com>
…ttps://github.com/percona/pcsm-docs into PCSM-283-Skip-sharding-operations-for-replica-set
Updated the source/target wording, clarified that finalization status should be polled until it reaches |
Co-authored-by: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
Some guidance remains incorrect for replica set targets and filtered replication.
Get a fresh assessment by requesting another Copilot review.
Review details
Suppressed comments (1)
docs/sharded-source-to-replica-set-target.md:53
- The heading should be capitalized consistently, and the comma after “See” is grammatically incorrect.
## usage
The commands and API endpoints are the same as for any other topology. See, [Percona ClusterSync for MongoDB commands](pcsm-commands.md) for the command reference.
- Files reviewed: 4/4 changed files
- Comments generated: 2
- Review effort level: Balanced
| {{pcsm.full_name}} supports replication from a sharded MongoDB cluster to another sharded cluster or to a replica set. | ||
|
|
||
| With a sharded target, you can migrate or synchronize data between sharded deployments with minimal downtime. With a replica set target, {{pcsm.full_name}} copies the data and skips the source sharding configuration. | ||
|
|
||
| For details about using a replica set as the target, see [Replicate from a sharded cluster to a replica set](sharded-source-to-replica-set-target.md). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Adnan <chupe@chupe.ba>
Co-authored-by: rasika-chivate <95711051+rasika-chivate@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
|
|
||
| | **On the source** | **On the replica set target** | | ||
| |---|---| | ||
| | Sharded collection | Created as a regular collection. Documents are copied only if `_id` values are unique across all source shards because the replica set target enforces collection-wide `_id` uniqueness. The shard key isn't applied because it doesn't apply to a replica set. | |
There was a problem hiding this comment.
This reads like PCSM checks _id uniqueness which it doesn't. During clone the inserts are unordered and duplicate key errors swallowed. That means some documents might go missing and unreported at that.
During replication an _id collision goes through delete by _id then insert.
Can we make this a prerequisite and a warning instead? _id has to be unique across all source shards, PCSM doesnt verify it. Duplicates are silently dropped or overwritten rather than failing the run.
It could be a pre-migration check too since it might lead to a silent data-loss.
|
|
||
| * **Replica Set to Replica Set**: The source and target replica sets can have different numbers of nodes. | ||
| * **Sharded cluster to Sharded cluster**: The source and target sharded clusters can have different numbers of shards. This functionality is in tech preview stage. See [Sharding support in {{pcsm.full_name}}](sharding.md) for details. | ||
| * **Sharded cluster to Replica Set**: Starting with PCSM 0.10.0, a sharded source cluster can replicate to a replica set target. Collections that are sharded on the source are created as regular collections on the target. For details, see [Replicate from a sharded cluster to a replica set](sharded-source-to-replica-set-target.md) for details. |
There was a problem hiding this comment.
nit: "For details, see [...] for details."
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
There was a problem hiding this comment.
What are the empty lines for?
Co-authored-by: Adnan <chupe@chupe.ba>
Add topology migration from Sharded Cluster to Replicaset.
For details, see the following ticket:
https://perconadev.atlassian.net/browse/PCSM-283