You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/09/09 14:45:00 UTC

[GitHub] [trafficcontrol] ocket8888 opened a new issue #6182: Server Changes Independent of Delivery Services

ocket8888 opened a new issue #6182:
URL: https://github.com/apache/trafficcontrol/issues/6182


   ## This Feature Request affects these Traffic Control components:
   - Traffic Control Cache Config (T3C, formerly ORT)
   - Traffic Control Client
   - Traffic Monitor
   - Traffic Ops
   - Traffic Portal
   - Traffic Router
   - Traffic Stats
   - Documentation
   
   ## Description
   What follows is transcribed from the "Self Service Change Integrity" Confluence wiki page:
   
   Currently, Traffic Control's Snapshot function captures all server changes, as
   applied to all Delivery Services.
   
   However, Operations workers must be careful, and will encounter race conditions,
   when changing Server assignments. For example, an Operator may apply a Server
   change which does not work with a particular Delivery Service field which was
   unset for all Delivery Services that Server is on, but which is quickly changed
   by a tenant. Likewise, two operators may be in the process of changing two
   different servers, and one may take a CDN Snapshot, inadvertently applying the
   other's half-finished changes.
   
   The following steps solve this problem.
   
   1. Add Traffic Ops Parameter modified timestamps
   	These are necessary to get the correct values for a given Server "Snapshot"
   
   1. Add Traffic Ops `profile_parameter` modified timestamps
   
   1. Add 'deleted' booleans to Server, Parameter, and Profile_Parameter tables.
   
   1. Change Server db table queries from `update` to `insert`
   
   	- timestamp changed to be part of the primary key
   	- CDN Snapshots simultaneously changed to create via `select latest timestamp`
   	- Deleting a Server or Parameter, or removing a Parameter from a Profile, must set the 'deleted' boolean in the insert.
   		this is how things are deleted, since we only ever insert now.
   
   1. Add Server Snapshots
   
   	- Change CRConfig generation to `select latest timestamp` for each Server
   	- At this stage, Portal UI changes (the next stage) may be deferred by simply changing the Snapshot function to update the database timestamp for every Server
   	- Note the overarching Snapshot timestamp must still exist, for other non-Delivery Service data
   	- Snapshotting a Server will generate up to 2 distinct "snapshot" timestamps in the database. A "server additions" timestamp, and a "server subtractions" timestamp. One timestamp will be one iota larger than the other (it doesn't matter which).
   		TODO: determine if "addition/subtraction" can be inferred, or must be a db field.
   	- All fields which are "subtractions" (e.g. removing a server from a Delivery Service) SHOULD have their update timestamps updated to match the Subtraction timestamp
   		- Alternatively, the `t3c` functions could ignore subtracting fields, when they know their snapshot is an Addition
   		- TODO model subtractions!?
   	- A timestamp will be generated if there are any additions. Additions include adding the Server to any Delivery Service, as well as most (all?) Server field changes
   	- A second timestamp will be generated if there are any subtractions. Subtractions include removing the Server from any Delivery Service. If the same user operation created an Addition, this timestamp MUST be exactly one iota larger.
   		Determine if any other 'subtractions' which must be Snapshotted-then-Queued exist
   
   1. Change CDN Snapshot generation from using the Server table's raw data (as of the given timestamp), to:
   
   	- The newest Server Snapshot which is a Subtraction, and newer than the Latest Applied Server Snapshot, but for which no older Addition snapshot exists, is retrieved.
   	- If no newer Subtraction exists before an Addition, the Latest Applied Server Snapshot is used.
   	- Then, all Server and Parameter data which is not newer than that timestamp is used to generate the CRConfig.
   
   1. Overhaul `t3c` to support Server Snapshots
   
   	- Add a Traffic Ops db field, similar to 'update pending' for the timestamp of a cache's latest applied Server snapshot.
   	- Add a Traffic Ops API endpoint and function for setting a cache's currently-applied-snapshot timestamp.
   	- Change `t3c` to check if the "Server Snapshot" for this cache which is "oldest newer than the Router Snapshot (which is the newest of all router hostnames)"; if newer than this cache's last snapshot, fetch and apply. - and "is subtraction"
   	- Change `t3c` to (after applying any necessary subtractions) immediately apply Additions which are newer than this cache's last applied snapshot timestamp, and which are NOT newer than the newest subtraction
   	- Change `t3c` from unsetting the Traffic Ops "Update Pending" boolean, to calling the new "cache's latest applied Server snapshot"
   
   1. Add Traffic Portal UI button on Delivery Service page to 'Snapshot Server'


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org