Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When a notify script is configured after Keepalived has been started, if other notify scripts are already configured, these scripts get reinvoked even if the state has not changed. This occurs when in backup state. When in master state, no notifications are sent out at all if a new notify script is configured. For the backup case, this problem occurs when the daemon is reloaded. This causes vrrp to leave the state it's currently in, go to the init state and from there, go back to backup. However, this transition causes the notify scripts to be invoked, causing a redundant notification to be sent. For the master case, there is no call to notify_instance_exec(), hence why no notifications are seen at all. The solution is to add a new field to the vrrp struct that stores the notify scripts that were configured before reload. A new function has been added to take advantage of this new field. Instead of calling notify_instance_exec() when we are in the init state, we now call notify_instance_exec_init(). This is a proxy function that modifies the 'script' member of a vrrp structure to point to a new list containing only scripts that have not previously been configured, thereby preventing the sending of notifications that have already been sent. This new list is created by utilising the new vrrp struct field. Inside this new function, notify_instance_exec() is called using the modified VRRP instance. When this call returns, the member is reset back to its original value. Signed-off-by: Colin Docherty <cdochert@brocade.com>
- Loading branch information
David Stapleton
authored and
Colin Docherty
committed
May 8, 2015
1 parent
a30a7c3
commit 89f9102
Showing
6 changed files
with
95 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters