[SERVER-49677] RoutingTableHistory::makeUpdated should skip copying chunkMap if it will result in no diffs Created: 16/Jul/20  Updated: 29/Oct/23  Resolved: 10/Aug/20

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: None
Fix Version/s: 4.7.0

Type: Improvement Priority: Major - P3
Reporter: Randolph Tan Assignee: Allison Easton
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-08-10
Participants:

 Description   

RoutingTableHistory currently copies the chunkMap unconditionally:

https://github.com/mongodb/mongo/blob/r4.4.0-rc12/src/mongo/s/chunk_manager.cpp#L600

And throws it away if it results in no diff:

https://github.com/mongodb/mongo/blob/r4.4.0-rc12/src/mongo/s/chunk_manager.cpp#L665

In special cases when the size of the changedChunks is 1, we can simply inspect the chunk and compare it to the chunk in the map and skip the copying all together when they are the same. This would save memory and computation in collections with millions of chunks.



 Comments   
Comment by Githook User [ 07/Aug/20 ]

Author:

{'name': 'Allison Easton', 'email': 'allison.easton@mongodb.com'}

Message: SERVER-49677 RoutingTableHistory::makeUpdated should skip copying chunkMap if it will result in no diffs
Branch: master
https://github.com/mongodb/mongo/commit/f0bd888de22307dad1825323cadd3b708f670ae0

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