Reduce TM dependency on CRConfig#6625
Conversation
c6a95a6 to
37599f1
Compare
37599f1 to
62cb43c
Compare
62cb43c to
0afd6fd
Compare
|
Rebased to resolve changelog merge conflicts. |
0afd6fd to
2fb2f49
Compare
ocket8888
left a comment
There was a problem hiding this comment.
I only made docs comments for the first version I encountered to avoid being overly repetitive. On that note: shouldn't these changes be made only to APIv4? I know the Snapshots have historically been unversioned, and "monitoring dot JSON" has always been a quasi-part of that snapshot, but it's used in TO Go client call signatures, so won't changing that be a breaking compile-time change?
rawlinp
left a comment
There was a problem hiding this comment.
shouldn't these changes be made only to APIv4?
I don't see why it can't be made to all versions, since this is non-breaking to the expected JSON formatting because it only adds new fields and doesn't change data types or rename existing fields.
As far as the TO client goes, this does technically make a breaking change to the TrafficServer and LegacyTrafficServer structs by changing the type of DeliveryServices from []tsdeliveryService to []TSDeliveryService, but the odds that any external client is actually using that field, when it wasn't even populated in the monitoring.json snapshot in the first place, seem drastically low. Therefore, I felt that is an OK breaking change.
That's fine with me, I suppose. It's not like we haven't broken that call signature in the recent past anyway - which I think was actually my doing. The docs pages for monitoring and Snapshots should really have a disclaimer about their instability. Right now monitoring has nothing and I think the Snapshots page has a "Caution" thing I put in saying how basically the guy writing the docs couldn't figure out a definite "shape" for that endpoint's data, so it needed updates from people who did. Should just be changed to "this, historically, just can't be relied upon to respect its versioning in the API". Not that I think you need to do that in this PR - although you're welcome to if you want. And, of course, I'll then need you to tank aggro when @rob05c finds out about it. |
|
I'll tank if you heal 😄 IMO all snapshots are unversioned because they should be handled as raw JSON data to which we can freely add new fields without making breaking changes. Plus, the fact that they're read-only means they're immune to round-trip data loss which could occur if a client were to drop unknown fields from a GET then make a PUT/POST without those fields. |
8a261df to
58c64d3
Compare
|
|
58c64d3 to
3b44bd1
Compare
fixed in #6678 |
506f160 to
ce8c251
Compare
However, this builds fine for me locally using docker... I can't really tell why it's failing here. |
Do not use CRConfig data when the same data already exists in the TMConfig. For data that TM needs but doesn't exist in TMConfig, add it to TMConfig. This way, TM only uses data in the TMConfig and can become simply a shuttle for the CRConfig without actually using any CRConfig data. Closes: apache#6512 Related: apache#1739 Related: apache#5367
ce8c251 to
96625bc
Compare
PR apache#6625 reduced the TM dependency on CRConfig data, but it accidentally caused TM to no longer poll for new CRConfig snapshots. This adds the CRConfig request back into the polling loop so that it updates its in-memory copy for internal use (if necessary) and for serving to TR.
* Fix TM issue where CRConfig is never updated PR #6625 reduced the TM dependency on CRConfig data, but it accidentally caused TM to no longer poll for new CRConfig snapshots. This adds the CRConfig request back into the polling loop so that it updates its in-memory copy for internal use (if necessary) and for serving to TR. * Add --buildvcs=false to 'go test' action
* Fix TM issue where CRConfig is never updated PR apache#6625 reduced the TM dependency on CRConfig data, but it accidentally caused TM to no longer poll for new CRConfig snapshots. This adds the CRConfig request back into the polling loop so that it updates its in-memory copy for internal use (if necessary) and for serving to TR. * Add --buildvcs=false to 'go test' action
Do not use CRConfig data when the same data already exists in the
TMConfig. For data that TM needs but doesn't exist in TMConfig, add it
to TMConfig. This way, TM only uses data in the TMConfig and can become
simply a shuttle for the CRConfig without actually using any CRConfig
data.
Closes: #6512
Related: #1739
Related: #5367
Which Traffic Control components are affected by this PR?
What is the best way to verify this PR?
Ensure the GHA tests pass. Take a snapshot of a CDN before this change, then take a snapshot after this change and compare the TMConfig snapshot to see the newly added fields. Compare the newly added fields to the corresponding data in the CRConfig snapshot (they should be the same). Run TM with the new snapshot and ensure it still polls and functions normally.
PR submission checklist