[SERVER-75431] Get rid or fix best effort check for primary db on rename path in sharded clusters Created: 29/Mar/23  Updated: 29/Oct/23  Resolved: 29/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 5.0.15, 7.0.0-rc0, 6.0.5, 6.3.0-rc2
Fix Version/s: 7.0.0-rc0, 6.0.6, 5.0.17, 6.3.1

Type: Bug Priority: Major - P3
Reporter: Pierlauro Sciarelli Assignee: Pierlauro Sciarelli
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v6.3, v6.0, v5.0
Participants:

 Description   

When a rename collection between different dbs is received by the (potential) primary shard of the source collection, a best effort check is executed before spawning the coordinator to make sure that both databases reside on the same shard (it's not allowed to rename collections between dbs with a different primary shard).

The check relies on cached info that may be stale, so the rename may fail even when both dbs reside on the same primary.

Solution 1
Change this check in order to refresh. The advantage is that rename operations can prematurely fail without serializing on the DDL lock when the dbs reside on different primary shards.

Solution 2

Simply get rid of the check because the same check is performed after spawning the coordinator when it is ensured the primary shard for the source db can't change.



 Comments   
Comment by Githook User [ 13/Apr/23 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-75431 Get rid or fix best effort check for primary db on rename path in sharded clusters
Branch: v6.3
https://github.com/mongodb/mongo/commit/cdbde83016a9236d91418fca00c70095841fde44

Comment by Githook User [ 30/Mar/23 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-75431 Get rid or fix best effort check for primary db on rename path in sharded clusters
Branch: v5.0
https://github.com/mongodb/mongo/commit/9d861c3e723e0444c78253f4193ae2c82dc39a15

Comment by Githook User [ 30/Mar/23 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-75431 Get rid or fix best effort check for primary db on rename path in sharded clusters
Branch: v6.0
https://github.com/mongodb/mongo/commit/73674b526948ffb48bee0df0c0c1a73d70c04a38

Comment by Githook User [ 29/Mar/23 ]

Author:

{'name': 'Pierlauro Sciarelli', 'email': 'pierlauro.sciarelli@mongodb.com', 'username': 'pierlauro'}

Message: SERVER-75431 Get rid or fix best effort check for primary db on rename path in sharded clusters
Branch: master
https://github.com/mongodb/mongo/commit/276d4d7f6d34bc4c6763107d33a93a3deb2c567b

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