On 19 April 2017 at 03:20, Sam Ruby <[email protected]> wrote:
> On Tue, Apr 18, 2017 at 6:19 AM, sebb <[email protected]> wrote:
>> https://github.com/apache/whimsy/blob/master/www/roster/public_json_common.rb#L85
>>
>> currently checks the hostname for the string 'vm2' to decide if the
>> host is the current master Whimsy or a test installation.
>>
>> However this currently allows both vm3 and vm4 to send mails.
>>
>> Is there a better way to determine which is the current server?
>>
>> Otherwise we'll have to keep adjusting the code.
>
> Perhaps it might be worth considering adding different SetEnv statements to:
>
> https://github.com/apache/infrastructure-puppet/blob/deployment/data/nodes/whimsy-vm3.apache.org.yaml
>
> and
>
> https://github.com/apache/infrastructure-puppet/blob/deployment/data/nodes/whimsy-vm3.apache.org.yaml
>
> ?

[The above URLs are the same; I assume you meant vm4 in one of them.]

The problem is ensuring that at least one (and ideally only one) host
is the current master.

This is tricky to do if multiple files have to be updated in parallel.
And even if the source files are updated at the same time, they may
not get synched at the same time.

So an env var of the form:

WhimsyMaster: true/false

could result in a window when neither host (or both) claims to be master.

Having no master means lost mails, so a better solution would be to
have a variable which defines the current master host name.

This could still result in a window when one has the old name and the
other the new name, but at worst there might be some duplicate mails.

The variable could perhaps be added to one of the shared Puppet
include files to avoid having to update both
whimsy-vm3.apache.org.yaml and whimsy-vm4.apache.org.yaml ?

Or maybe it would be easier to have a properties file (or a lib/
function) in the codebase?


> And perhaps add a convenience method to query the environment to:
>
> https://github.com/apache/whimsy/blob/master/lib/whimsy/asf.rb
>
>> S.
>
> - Sam Ruby

Reply via email to