You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add support to replace the AccessPoint in ProxyDestination
Summary:
Add support to replace the AccessPoint in ProxyDestination
1. Use ProxyMessage to send message to Proxy thread to do the actual change of access point in Proxy thread context and not in config thread context. The Proxy object does the actual replacement of the access point by finding the ProxyDestination in the ProxyDestinationMap using the temporary old access point constructed from the IP address that is replaced.
2. Put the new destination in TKO mode (because the new host won't be ready anyways and so pro-actively put the destination in TKO mode)
3. replace shared_ptr<AccessPoint> in ProxyDestination with folly::atomic_shared_ptr<AccessPoint>
Description of the AP replacement logic:
```
caller calls Proxy->replaceAccessPoint() with temp old AP constructed from old IP address/port
send a message to Proxy thread to find and replace old AP
```
Proxy thread upon receiving the replace AP message
```
calls processReplaceMessage( tmpOldAP, newAP)
which calls ProxyDestinationMap::replace(tmpOldAP, newAP)
This function uses tmpOldAP to find the realOldAP in the Proxy DestinationMap
If it is found, it is erased first because the MAP used AP internally to identify the destination
Then replaces the old AP with new AP
and inserts the destination back into the MAP which internally uses new AP to correctly place it in the MAP
Finally returns the old AP so that it map be used by the caller
```
Reviewed By: stuclar
Differential Revision: D25416686
fbshipit-source-id: 7ad38e21dd60811f75d56903c0d6a029363c459d
0 commit comments