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

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major - P3 Major - P3
    • 7.2.1, 7.3.0-rc0, 7.0.5
    • 7.0.0, 7.3.0-rc0, 7.2.0-rc1
    • 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

    Description

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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: