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

Disallow tracking unsupported collection types as part of moveCollection

    • Type: Icon: Bug Bug
    • Resolution: Gone away
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Catalog and Routing
    • ALL
    • v8.0
    • Hide

      const st = new ShardingTest(

      {mongos: 1, shards: 2}

      );
      const mongos = st.s;
      const shard0 = st.shard0.shardName;
      const shard1 = st.shard1.shardName;

      const dbName = "db";
      const collName = "coll";
      const ns = dbName + '.' + collName;

      assert.commandWorked(mongos.adminCommand(

      {enableSharding: dbName, primaryShard: shard0}

      ));

      assert.commandWorked(mongos.getDB(dbName).runCommand({create: collName, timeseries: {timeField: 'time'}}));

      // Fail because moving timeseries is not supported yet
      assert.commandFailedWithCode(mongos.adminCommand(

      {moveCollection: unsplittableCollNs, toShard: shard1}

      ), ErrorCodes.NotImplemented);

      // The moveCollection command tracked the collection on the config server (even though timeseries are not properly supported ATM)
      assert.eq(1, mongos.getDB('config').collections.countDocuments({_id: dbName + '.system.buckets.' + collName}));

      Show
      const st = new ShardingTest( {mongos: 1, shards: 2} ); const mongos = st.s; const shard0 = st.shard0.shardName; const shard1 = st.shard1.shardName; const dbName = "db"; const collName = "coll"; const ns = dbName + '.' + collName; assert.commandWorked(mongos.adminCommand( {enableSharding: dbName, primaryShard: shard0} )); assert.commandWorked(mongos.getDB(dbName).runCommand({create: collName, timeseries: {timeField: 'time'}})); // Fail because moving timeseries is not supported yet assert.commandFailedWithCode(mongos.adminCommand( {moveCollection: unsplittableCollNs, toShard: shard1} ), ErrorCodes.NotImplemented); // The moveCollection command tracked the collection on the config server (even though timeseries are not properly supported ATM) assert.eq(1, mongos.getDB('config').collections.countDocuments({_id: dbName + '.system.buckets.' + collName}));
    • CAR Team 2024-04-01, CAR Team 2024-04-15, CAR Team 2024-04-29

      There are some types of unsharded collections that are not currently trackable in the config server.

      SERVER-87625 changed moveCollection to register the namespace it's being called on. It does so by reusing the create command that eventually ends up calling the create coordinator.

      Since the command is invoked without the current collection options, those checks are skipped and we may end up tracking an unsupported type of collection.

            Assignee:
            allison.easton@mongodb.com Allison Easton
            Reporter:
            pierlauro.sciarelli@mongodb.com Pierlauro Sciarelli
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: