CLOUDP-329178 - Support Project Migration in Sharded Clusters #399
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This pull request introduces process ID persistence for MongoDB sharded cluster deployments, ensuring that process IDs for replica sets are correctly maintained across reconciliation cycles and during migration scenarios (such as project changes). This is achieved by storing process IDs in the deployment state and updating the controller logic and tests accordingly.
Process ID Persistence for Sharded Clusters:
ProcessIdsfield to theShardedClusterDeploymentStatestruct to store process IDs for each replica set, enabling persistence across reconciliation cycles and project migrations.buildReplicaSetFromProcessesfunction and its call sites to retrieve and use persisted process IDs from the deployment state when process IDs are missing (e.g., during migration).Controller Logic Enhancements:
Testing Improvements:
mongodbshardedcluster_controller_test.goto verify process ID persistence, retrieval, edge cases, and JSON serialization/deserialization for state store compatibility. Also, tested the integration with the updatedbuildReplicaSetFromProcessesand the new process ID persistence logic.End-to-End (E2E) Test Enhancements:
multi_cluster_sharded_scaling.pyto verify that process IDs are preserved during project migration scenarios, including the creation of non-sequential member IDs and asserting that replica set member IDs remain unchanged after migration.These changes collectively improve the robustness of sharded cluster management, particularly in scenarios involving cluster migration or changes to Ops Manager configuration.
Proof of Work
Checklist
skip-changeloglabel if not needed