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 2018/05/01 21:30:52 UTC

[GitHub] rob05c commented on issue #2199: Add Grove In-Place Upgrades

rob05c commented on issue #2199: Add Grove In-Place Upgrades
URL: https://github.com/apache/incubator-trafficcontrol/issues/2199#issuecomment-385796896
 
 
   Idea: serialize the cache to a file, using pointers to quickly lock and copy.
   
   So, the cache under the hood is a standard Go map.
   
   The map must be locked while copying. Copying the actual values takes a long time, but simply copying the pointers should be fast enough to globally lock while we do it.
   
   Currently, Cache Objects aren't changed, they're inserted, and if they're modified, a copy is made. This is probably necessary anyway, since concurrent requests for the same object may modify concurrently.
   
   As long as we guarantee CacheObj objects in the map are immutable, we can copy the pointers quickly, then serialize the actual objects to a file, which takes much longer, in a separate thread.
   
   Then, the upgraded binary can start, read the serialized cache to fill its own in memory.
   
   The problem with this, is that the cache can then only be half the size of memory, since we'll be briefly holding two copies of it.
   
   We really need a way to reuse the same memory, or to move objects out of the old and into the new one-at-a-time, while at the same time, making new requests for objects go to the right cache.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services