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

createView fails with StaleConfig if a sharded collection already exists with the same namespace

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.2.1, 7.3.0-rc0, 7.0.5
    • Affects Version/s: 7.0.0, 7.3.0-rc0, 7.2.0-rc1
    • Component/s: None
    • None
    • Catalog and Routing
    • Fully Compatible
    • ALL
    • v7.2, v7.0
    • Hide
      const st = new ShardingTest({mongos: 1, shards: 2, rs: {nodes: 1}});
      
      const db = st.s.getDB(jsTestName());
      
      assert.commandWorked(db.runCommand({shardCollection: "collA",key:{x:1}}));
      assert.commandFailedWithCode(db.runCommand({create: "collA", viewOn: "a"}),
                                   ErrorCodes.NamespaceExists);
      
      st.stop();
      
      Show
      const st = new ShardingTest({mongos: 1, shards: 2, rs: {nodes: 1}}); const db = st.s.getDB(jsTestName()); assert.commandWorked(db.runCommand({shardCollection: "collA",key:{x:1}})); assert.commandFailedWithCode(db.runCommand({create: "collA", viewOn: "a"}), ErrorCodes.NamespaceExists); st.stop();
    • CAR Team 2023-12-11

      Creating a view with the name of an already existing sharded collection throws StaleConfig when it should throw a NamespaceExists error.

            Assignee:
            enrico.golfieri@mongodb.com Enrico Golfieri
            Reporter:
            silvia.surroca@mongodb.com Silvia Surroca
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: