Slave servers should not check the policy queue or replicate events.

This commit is contained in:
Ramon Novoa 2016-11-29 12:59:44 +01:00
parent 17bf92b695
commit d41f8802f6
1 changed files with 14 additions and 0 deletions

View File

@ -4270,6 +4270,13 @@ sub pandora_process_event_replication ($) {
logger($pa_config, "Starting replication events process.", 1); logger($pa_config, "Starting replication events process.", 1);
while(1) { while(1) {
# If we are not the master server sleep and check again.
if (pandora_is_master($pa_config) == 0) {
sleep ($pa_config->{'server_threshold'});
next;
}
# Check the queue each N seconds # Check the queue each N seconds
sleep ($replication_interval); sleep ($replication_interval);
enterprise_hook('pandora_replicate_copy_events',[$pa_config, $dbh, $dbh_metaconsole, $metaconsole_server_id, $replication_mode]); enterprise_hook('pandora_replicate_copy_events',[$pa_config, $dbh, $dbh_metaconsole, $metaconsole_server_id, $replication_mode]);
@ -4294,6 +4301,13 @@ sub pandora_process_policy_queue ($) {
logger($pa_config, "Starting policy queue patrol process.", 1); logger($pa_config, "Starting policy queue patrol process.", 1);
while(1) { while(1) {
# If we are not the master server sleep and check again.
if (pandora_is_master($pa_config) == 0) {
sleep ($pa_config->{'server_threshold'});
next;
}
# Check the queue each 5 seconds # Check the queue each 5 seconds
sleep (5); sleep (5);