Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-86758

Create a JS test hook to randomly move unsharded collections in backround

    • Catalog and Routing

      In tests suite that have the `random_migrations` options enabled, we make the balancer move chunks randomly by mean of setting balancerShouldReturnRandomMigrations faipoint.
      In SERVER-85441 we additionally made so that the balancer will also move randomly unsharded collections using the new moveCollection command.

      In 8.0 collections won't be tracked on creation but rather tracked implicitly the first time someone attempt to move them through the moveCollection command.

      Until the collections are not tracked in the sharding catalog the balancer won't see them and won't attempt to move them.

      The goal of this ticket is to implement a mechanism so that the suites with random_migrations enabled will actually move untracked unsharded collections.

      Some ideas to implement this:

      • Create a background hook that use a test command to register unsharded collections in the sharding catalog after they have been created. Once the collections are tracked the balancer will randomly move them.
        • Cons: this hook will still relies on the balancer to actually move them. So if we want to change the logic that decide what to move we will need to change balancer code. The CAR team does not own anymore the balancer.
      • Create a background hook that perform moveCollection randomly over unsharded collection.
        • Cons: The hook will need to encode some current logic of the balancer to ensure migrations will be throttled and that multiple migrations will be executed concurrently.
        • Pros: We can encode the random migration logic entirely in the hook with great freedom of flexibility (JS easier than C++) without depending on the balancer. The hook can be extended in the future with more background operations.
      • We make sure that in those suites collections are always registered on creation
        • Downside: currently we are not able to track collection on creation if they are created inside transactions or retriable writes. Thus this approach will miss some coverage.

            Assignee:
            backlog-server-catalog-and-routing [DO NOT USE] Backlog - Catalog and Routing
            Reporter:
            tommaso.tocci@mongodb.com Tommaso Tocci
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: