[SERVER-81155] Use move semantic to avoid copying all chunks in createCollection coordinator Created: 18/Sep/23  Updated: 29/Oct/23  Resolved: 20/Sep/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: 4.2.24, 7.0.1, 4.4.24, 6.0.10, 5.0.21, 7.1.0-rc3
Fix Version/s: 7.2.0-rc0, 5.0.22, 6.0.11, 7.0.3

Type: Improvement Priority: Major - P3
Reporter: Tommaso Tocci Assignee: Tommaso Tocci
Resolution: Fixed Votes: 0
Labels: car-71-backport-declined
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Assigned Teams:
Sharding EMEA
Backwards Compatibility: Fully Compatible
Backport Requested:
v7.1, v7.0, v6.0, v5.0, v4.4
Sprint: Sharding EMEA 2023-10-02
Participants:

 Description   

In the createCollection coordinator we accidentally copy all chunks after we serialize them. To avoid this copy we could simply use move semantic.

While in versions 6.0+ this is not particularly problematic because we usually do not have a huge number of chunks, in previous versions (<= 5.0) the number of chunks could be very high, on the order of millions.



 Comments   
Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-81155 Use move semantic to avoid copying all chunks in createCollection coordinator
Branch: v7.0
https://github.com/mongodb/mongo/commit/8f87c384b359af4e684e6a0d41e2e42aeee51c93

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-81155 Use move semantic to avoid copying all chunks in createCollection coordinator
Branch: v6.0
https://github.com/mongodb/mongo/commit/9a461b6cf632ad26822df320d7cfcf8e516251bd

Comment by Githook User [ 21/Sep/23 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-81155 Use move semantic to avoid copying all chunks in createCollection coordinator
Branch: v5.0
https://github.com/mongodb/mongo/commit/567ad8af7677e908f352b7c17f193c17c6a86ecf

Comment by Githook User [ 20/Sep/23 ]

Author:

{'name': 'Tommaso Tocci', 'email': 'tommaso.tocci@mongodb.com', 'username': 'toto-dev'}

Message: SERVER-81155 Use move semantic to avoid copying all chunks in createCollection coordinator
Branch: master
https://github.com/mongodb/mongo/commit/7e36a45d31a6d5f2c1edcd1a4f009a86bd209210

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