-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Storage Execution
-
ALL
Creating a clustered collection is not idempotent. For example, running the following with the sharding_clustered_collections suite:
const rs = new ReplSetTest({nodes: 3}); rs.startSet(); rs.initiate(); const db = rs.getPrimary().getDB("db"); assert.commandWorked(db.runCommand({create: "coll"})); assert.commandWorked(db.runCommand({create: "coll"})); rs.stopSet();
results in the following error on the second call to `create`:
uncaught exception: Error: command failed: { "ok" : 0, "errmsg" : "namespace db.coll already exists, but with different options: { uuid: UUID(\"1d5b16a6-2424-4778-8e1d-bc397571bbc1\"), clusteredIndex: { v: 2, key: { _id: 1 }, name: \"_id_\", unique: true } }", "code" : 48, "codeName" : "NamespaceExists", },