rawlinp opened a new pull request #5482: URL: https://github.com/apache/trafficcontrol/pull/5482
## What does this PR (Pull Request) do? Clearing the existing map and putting all the new steerings into it can potentially cause a race where the map is empty or partially empty when doing steering lookups for incoming requests. Instead, swap the old map with the new map (which is atomic). Additionally, improve the steering registry logging so that only changes are logged, rather than re-printing the entire registry when a single entry is changed. ## Which Traffic Control components are affected by this PR? - Traffic Router ## What is the best way to verify this PR? 1. Create a couple `CLIENT_STEERING` delivery services with a few targets each (preferably using `STEERING_ORDER`). 2. Snapshot the CDN. 3. Start up TR, wait for it to finish processing the snapshot. 4. Request one of the `CLIENT_STEERING` DSes from TR, ensure that the returned `locations` list is ordered as expected. 5. Change the `STEERING_ORDER` values of that DS's steering targets, observe the TR logs, ensure that it only logs the target configurations of the changed `CLIENT_STEERING` DS. 6. Repeat step 4. ## If this is a bug fix, what versions of Traffic Control are affected? - master - 5.x - 4.x ## The following criteria are ALL met by this PR - [x] fairly trivial change, race condition is difficult to reproduce in a test - [x] bugfix, no docs necessary - [x] This PR includes an update to CHANGELOG.md OR such an update is not necessary - [x] This PR includes any and all required license headers - [x] This PR **DOES NOT FIX A SERIOUS SECURITY VULNERABILITY** (see [the Apache Software Foundation's security guidelines](https://www.apache.org/security/) for details) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
