[SERVER-82806] Received null actualCollection when unsplittable collection exists with given uuid Created: 04/Nov/23  Updated: 30/Nov/23  Resolved: 30/Nov/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.3.0-rc0

Type: Bug Priority: Major - P3
Reporter: Silvia Surroca Assignee: Jordi Olivares Provencio
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Catalog and Routing
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

const st = new ShardingTest({
    mongos: 1,
    shards: 2,
    rs: \{nodes: 1},
});
 
const testDB = st.s.getDB(jsTestName());
const shard0 = st.shard0.shardName;
const shard1 = st.shard1.shardName;
 
assert.commandWorked(st.s.adminCommand(\{enableSharding: testDB.getName(), primaryShard: shard0}));
 
// create collA with 1 index on the DBPrimary shard
const collA = testDB['collA'];
assert.commandWorked(testDB.runCommand(\{createUnsplittableCollection: 'collA'}));
assert.commandWorked(collA.insert(\{x: 1, y: 2}));
assert.commandWorked(collA.createIndex(\{y: 1}));
 
const uuidCollA =
    testDB.getSiblingDB('config').collections.findOne(\{_id: collA.getFullName()}).uuid;
 
// create collB with 1 index not on the DBPrimary shard
const collB = testDB['collB'];
assert.commandWorked(testDB.runCommand(\{createUnsplittableCollection: 'collB', dataShard: shard1}));
assert.commandWorked(collB.insert(\{x: 1, y: 1}));
assert.commandWorked(collB.createIndex(\{y: 1}));
 
// send dropIndexes with a wrong collectionUUID field
const res = assert.commandFailedWithCode(
    testDB.runCommand(\{dropIndexes: "collB", index: {y: 1}, collectionUUID: uuidCollA}),
    ErrorCodes.CollectionUUIDMismatch);
 
assert.eq(res.actualCollection, collA.getName());
 
st.stop();

Sprint: CAR Team 2023-11-27, CAR Team 2023-12-11
Participants:

 Description   

Given 2 unsplittable collections living on different shards (collA and collB), when a command is sent with the opposite collectionUUID field, the returned actualCollection is null when it's expected to receive the name of the other collection.

 

For instance:

  • collA has uuidA
  • collB has uuidB

Command {dropIndexes: "collA", index: {x:1}, collectionUUID: uuidB} will return a null actualCollection field.

 



 Comments   
Comment by Githook User [ 29/Nov/23 ]

Author:

{'name': 'Jordi Olivares Provencio', 'email': 'jordi.olivares-provencio@mongodb.com', 'username': 'jordiolivares'}

Message: SERVER-82806 Fix unsplittable collection UUID mismatch errors
Branch: master
https://github.com/mongodb/mongo/commit/8b2eea8a2a0343f5533dd171e3d773bee4d0148d

Generated at Thu Feb 08 06:50:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.