[SERVER-33631] Refactor rename_collection.cpp Created: 02/Mar/18  Updated: 29/Oct/23  Resolved: 29/Apr/19

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.1.11

Type: Improvement Priority: Major - P3
Reporter: Xiangyu Yao (Inactive) Assignee: Xiangyu Yao (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Storage NYC 2019-04-22, Storage NYC 2019-05-06
Participants:

 Description   

I realized there were some code better to be refactored when I did SERVER-33087 such as:
1. renameCollectionCommon is shared by both user command's renameCollection and applyOps's renameCollection but those two actually have enough differences.
2. The parameter TargetUUID is actually the UUID of the source.
3. We should use the UUID of the source as the single source of truth, making the API of renameCollection like "rename UUID1 to ABC, drop UUID2".
4. A lot of the unit tests use an arbitrary UUID as the UUID of the source because it's convenient. We should fix those and put invariants in the rename_collection.cpp.
5. Disable rename across database via applyOps.



 Comments   
Comment by Githook User [ 29/Apr/19 ]

Author:

{'email': 'xiangyu.yao@mongodb.com', 'name': 'Xiangyu Yao', 'username': 'xy24'}

Message: SERVER-33631 Refactor rename_collection.cpp
Branch: master
https://github.com/mongodb/mongo/commit/f86e1314a0acdcf209d1a5ff887ee192ea11b635

Generated at Thu Feb 08 04:34:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.