Keepalived - New pre-release version available
Quentin Armitage <[email protected]> Sun, 29 Oct 2017 16:10:37 +0000
| Newsgroups | gmane.linux.keepalived.devel |
|---|---|
| Organization | The Armitage family |
| Message-ID | <[email protected]> |
I have today pushed a major update to keepalived that adds a large amount of new functionality, efficiency improvements, and speeding up of actions after events occur (e.g. transition to master from backup, state changes after track_script execution). The new code is available in the beta branch at https://github.com/acassen/keepalived/tree/beta , and below is a list of the main changes from the master branch. It is intended that this branch will form the basis of the next major release of keepalived, and it is very much hoped that as many people as possible will be able to test this new code prior to its full release. If you have successfully tested/tried the new code, any reports of what you have done and how it worked would be very useful. Issue #686 at htt ps://github.com/acassen/keepalived/issues/686 has been created for this purpose. If you find any issues with the new code, please report them using the Issues feature on github at https://github.com/acassen/keepalived/issues id="-x-evo- selection-start-marker">. Please clearly indicate that the issue was found with the beta branch code (add the beta label to the issue), include the output of keepalived -v, a copy of your configuration, what Linux distrubution you are running on, and whether you are running keepalived in a VM or container, with details of those as appropriate. Have fun with it, and many thanks in advance for any test reports. Quentin Armitage The following enhancements are included in this branch. 1. Transition to master as soon as decision is made to do so, rather than wait one further advert interval. This meant that previously if a master went down and sent a priority 0 message, there was one extra advert interval before the highest priority backup configured the VIP addresses. This means that if vrrp instances have high priorities (i.e. close to 255), then the transition to master and configuration of addresses will now occur in a small multiple of advert_interval/256. 2. Process interface state changes immediately rather than waiting for timer expiry. The problem was that if an interface went down and came back up before the next timer expiry, and addresses, routes and VMACs that we had configured on that interface would be removed, but we would't know about it. 3. Add support for hot-swappable NICs, i.e. handle interfaces being deleted and restored. 4. Add vrrp_track_file option. This allows track_scripts, which are run on a frequent scheduled basis, to be replaced with a vrrp_track_file, which contains a number as a text string which is used in the same way as the exit status from a track script. The track_files are only read if they are changed, so external events can update a track file, rather than their status needing to be detected by polling by track scripts. 5. Add notify fifos. Rather than sending notifications via notify scripts it is now possible to send notify messages via fifos. Not only does this mean that the overhead of executing script for each notification is removed, but it also guarantees the delivery of notifications in the correct order, whereas if the notification is via scripts, there is no guarantee that the scripts will execute in the desired order if two or more notifications are sent in quick succession. There can be a global fifo to process all notifies, and also separate fifos for vrrp and checkers. It is possible to specify a script for keepalived to execute to process the messages on the fifo(s). 6. Stop logging address addition/deletions if they are not relevant to keepalived (unless the -a option is specified). 7. Transition to fault state if source address for adverts is deleted from interface 8. Transition to backup state if a VIP or eVIP is removed. When we next transition to master the addresses will be restored. If nopreempt is not set, that will be almost immediately. 9. Make an address owner (priority 255) transition to master immediately 10. Don't process a received advert if the authentication fails. 11. Ignore invalid received adverts totally (the master down timer was being updated, which meant that a backup could be stuck in backup state even if the only received adverts were invalid). 12. Don't reset timer before sending next advert if receive a lower priority advert. 13. Log if receive invalid authentication header 14. Ignore lower priority adverts when backup (to comply with RFCs) this also means that the master down timer isn't reset, which was causing a delay to becoming master 15. Fix first advert interval of vrrp instances in a sync group. 16. Stop two vrrp instances with preempt delay and equal priorities flip- flopping between master and backup state 17. Make sync group members transition state at same time as first instance makes transition (i.e. when the trigger event occurs) rather than wait for next timer expiry 18. If a vrrp track script returns a new status code, process that immediately for all instances (and their sync group members) rather than waiting for the next timer expiry on each instance. 19. On reload, make track scripts inherit the last state from before the reload. This stops vrrp instances transitioning to down and coming back up once the script has run. 20. Correct the use of adver_int and master_adver_int 21. Ensure when leaving fault state that a vrrp instance transitions to backup unless it has priority 255 22. Remove quick_sync functionality since no longer needed. 23. Improved code efficiency: a. Finding vrrp instance after read timeout b. When getting interface information for a new vmac, only request information for that i/f. c. Directly update effective priority of vrrp instances when scripts return new status rather than scheduling a thread to do it d. Don't run a read timeout on vrrp instance in fault state e. Don't run a track script if no vrrp instance is tracking it f. Stop checking interface status after every timer expiry since processing interface state changes is now done synchronously g. The timeout for the select call had a maximum timeout of 1 second, it now times out only when something needs to happen h. The timeout on netlink reads was 500 seconds and this has been extended to 1 day. i. Streamline signal handling between main process and child process by using signalfd if available, rather than using a pipe j. Minimise searching for an interface struct based on its index by using pointers to the interface structures k. Stop opening and closing vrrp scripts before running them. We can detect they are missing from the return of the exec call. l. Allow threads that don't need a timeout to never timeout m. Calculate the maximum fd number when calling select() rather than specifying the maximum of 1024. m. Ignore netlink NEWLINK messages that are only wireless state changes. o. Don't check whether timers have expired after select() returns if its timeout didn't expire. p. Termination of child processes (scripts) were being handled twice q. Don't generate the IP header checksum since the kernel will always generate it. r. Maintain pointers to tracking scripts to save seaching a list to find the relevant script. s. Vrrp instances to have pointer to interface structure to avoid having to search based in index 24. Fix the checksum calculation for VRRPv3 unicast peers. 25. Don't regenerate the full vrrp_advert packet data each time an advert is sent; simply update the necessary fields and calculate the change needed to the checksum. 26. Detect a vmac interface going down, and make the vrrp instance transition to fault state. Previously the instance would only go down if the underlying interface went down. 27. Stop weighted track scripts updating priority of sync group members 28. Make vrrp instances go straight to fault state at startup if a relevant interface is down, rather than start in up state and transition to fault at next timer expiry 29. Ensure that a sync group starts in backup state unless all members are address owners 30. Restore master down timer after leaving fault state 31. Use execve() to execute scripts rather than system(). This saves a fork and an extra process, and also allows the parameters to be parsed once only at startup, rather than each time the script is invoked. 32. Don't treat a failure to execute a script as a failure of the script. 33. Ensure all scripts receive TERM signal when keepalived terminates 34. If keepalived is running with an elevated priority, stop running scripts with that elevated priority. 35. Enable an unweighted tracking script make a vrrp instance which is an address owner transition to fault state 36. Delay bringing vrrp instances up at startup until after the first completion of the tracking scripts to stop an instance coming up an then being brought back down again after the script completes with a failure. 37. Reduce number of error messages if a script is not executable 38. Add linkbeat option per vrrp instance 39. Fix timer addition on 32-bit systems 40. Ignore netlink messages for interfaces using linkbeat polling 41. If priority of vrrp instance changes when in backup due to a vrrp script, reschedule the read timeout 42. If re-using a VMAC after a reload, ensure it is correctly configured 43. Don't send priority 0 adverts when transition to fault state unless were in master mode 44. Identify routes added by keepalived as belonging to keepalived 45. Enable vrrp instances to be put into fault state if their routes are removed 46. Add track scripts and track files and track_if to sync groups and deprecate global_tracking (use sync_group_tracking_weight instead, but only if necessary). 47. Improve AH authentication sequence number handling, and (re)enable sequence number checking for VMACs and sync groups The things remaining to do include: 1. Addresses being removed (static and vips) tracking static addresses 2. Routes/rules being removed (static and dynamic) route can be removed if i/f goes down tracking static rules/routes 3. Allow specification for interfaces on existing at startup - but report them. When interface later created, bring up any vrrp instances and routes that should be using it. 4. May need to restore static routes/addresses when interfaces are restored 5. Add track_if/track_route for static routes 6. Add option for whether vrrp instance to go down if static/dynamic rule/route/address disappears 7. Add static addresses and routes on vmacs ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ Keepalived-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/keepalived-devel