[SERVER-75907] Do not use const_cast in sdamServerSelector::_getCandidateServers() Created: 10/Apr/23  Updated: 29/Oct/23  Resolved: 01/Aug/23

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

Type: Improvement Priority: Major - P3
Reporter: Wenqin Ye Assignee: Kruti Shah
Resolution: Fixed Votes: 0
Labels: neweng, sharding-nyc-subteam2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Sharding NYC
Backwards Compatibility: Fully Compatible
Sprint: Sharding NYC 2023-07-24, Sharding NYC 2023-08-07
Participants:
Story Points: 2

 Description   

The server_selector uses a const_cast to update the passed in criteria in `sdamServerSelector::_getCandidateServers`. const_cast is not great to use because it is modifying a const reference that should not be modified. Right now this does not cause a bug, and is more of a code cleanup ticket.



 Comments   
Comment by Githook User [ 02/Aug/23 ]

Author:

{'name': 'Kruti Shah', 'email': 'kruti139@gmail.com', 'username': 'krutishah139'}

Message: SERVER-75907 Remove const_cast
Branch: minh.luu-no_compile_sys-perf
https://github.com/mongodb/mongo/commit/15f5eeceab0d5a4c9fbbeede40437fe40aaef558

Comment by Githook User [ 01/Aug/23 ]

Author:

{'name': 'Kruti Shah', 'email': 'kruti139@gmail.com', 'username': 'krutishah139'}

Message: SERVER-75907 Remove const_cast
Branch: master
https://github.com/mongodb/mongo/commit/15f5eeceab0d5a4c9fbbeede40437fe40aaef558

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