Skip to content

Conversation

@chupe
Copy link
Collaborator

@chupe chupe commented Dec 1, 2025

PCSM-202 Powered by Pull Request Badge

PCSM-202: Make local sharded cluster setup configurable

Add flexible shard configuration to hack/sh environment with support
for asymmetric cluster testing (different shard counts between source
and target). Also remove authentication from all local dev environments
to simplify setup and avoid Docker volume permission issues.

Authentication removal (all environments: rs, sh, sh-ha):

  • Remove keyFile files and keyFile config from all *.conf files
  • Remove users.adm.js and users.js user creation scripts
  • Update hack/util rsinit function to skip user creation
  • Remove auth prefixes (adm:pass@) from all mongosh calls
  • Fix hack/cleanup.sh to handle sh-ha environment properly

Configurable shard setup (hack/sh):

  • Make run.sh configurable via SRC_SHARDS and TGT_SHARDS env vars
    • Default: 2 shards each (changed from hardcoded 3→2)
    • Maximum: 3 shards each (validated against available init scripts)
    • Dynamic service startup and initialization loops
    • Usage documentation in script header
  • Add third shard support for both source and target
    • Create hack/sh/mongo/src/rs2.js init script
    • Create hack/sh/mongo/tgt/rs2.js init script
    • Add src-rs20 and tgt-rs20 services/volumes to compose.yml
  • Add hack/cleanup.sh script for environment teardown
  • Add /tmp/ to .gitignore for demo artifacts

Test configurations now supported:

  • 1→1, 2→2, 3→3 shards (symmetric)
  • 3→2, 2→3 shards (asymmetric, for PCSM-202 testing)
  • Any combination from 1-3 shards per cluster

Usage examples:
./hack/sh/run.sh # 2→2 (default)
SRC_SHARDS=3 TGT_SHARDS=2 ./hack/sh/run.sh # 3→2
SRC_SHARDS=2 TGT_SHARDS=3 ./hack/sh/run.sh # 2→3
SRC_SHARDS=1 TGT_SHARDS=1 ./hack/sh/run.sh # 1→1

Add flexible shard configuration to hack/sh environment with support
for asymmetric cluster testing (different shard counts between source
and target). Also remove authentication from all local dev environments
to simplify setup and avoid Docker volume permission issues.

Authentication removal (all environments: rs, sh, sh-ha):
- Remove keyFile files and keyFile config from all *.conf files
- Remove users.adm.js and users.js user creation scripts
- Update hack/util rsinit function to skip user creation
- Remove auth prefixes (adm:pass@) from all mongosh calls
- Fix hack/cleanup.sh to handle sh-ha environment properly

Configurable shard setup (hack/sh):
- Make run.sh configurable via SRC_SHARDS and TGT_SHARDS env vars
  - Default: 2 shards each (changed from hardcoded 3→2)
  - Maximum: 3 shards each (validated against available init scripts)
  - Dynamic service startup and initialization loops
  - Usage documentation in script header
- Add third shard support for both source and target
  - Create hack/sh/mongo/src/rs2.js init script
  - Create hack/sh/mongo/tgt/rs2.js init script
  - Add src-rs20 and tgt-rs20 services/volumes to compose.yml
- Add hack/cleanup.sh script for environment teardown
- Add /tmp/ to .gitignore for demo artifacts

Test configurations now supported:
- 1→1, 2→2, 3→3 shards (symmetric)
- 3→2, 2→3 shards (asymmetric, for PCSM-202 testing)
- Any combination from 1-3 shards per cluster

Usage examples:
  ./hack/sh/run.sh                          # 2→2 (default)
  SRC_SHARDS=3 TGT_SHARDS=2 ./hack/sh/run.sh  # 3→2
  SRC_SHARDS=2 TGT_SHARDS=3 ./hack/sh/run.sh  # 2→3
  SRC_SHARDS=1 TGT_SHARDS=1 ./hack/sh/run.sh  # 1→1
- Root cause: Local dev removed auth in b2aac89, but CI workflows still had
  partial auth setup causing WaitTimeoutError in test_drop_capped_collection
  and test_drop_database tests
- Delete user creation scripts from CI (users.adm.js, users.js)
- Update util scripts to skip user creation in rsinit function
- Remove adm:pass@ credentials from mongos connections in sh/run
- Update e2etests.yml to use connection strings without credentials
- Ensures consistency: both CI and local dev now run without authentication
@inelpandzic inelpandzic marked this pull request as ready for review December 4, 2025 12:58
@chupe chupe merged commit 73cece2 into main Dec 5, 2025
27 checks passed
@chupe chupe deleted the pcsm-202 branch December 5, 2025 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants