Skip to content

Conversation

@inouekazu
Copy link

This request is a proposal patch about exclusion of the ticket, adds a function which does not grant that ticket to the site specified by exclude_site in booth.conf.

The example for which this function is needed.

  • There are three sites. I want to operate two services (two tickets).
  • However, I want to operate only one service at one site.

example of configuration

site="192.168.203.101"
site="192.168.203.102"
site="192.168.203.103"

ticket="ticketA"
        exclude_site = 192.168.203.102
ticket="ticketB"
        exclude_site = 192.168.203.101
  • Then, I grant ticketA to 192.168.203.101 and ticketB to 192.168.203.102.
  • By doing so, only 192.168.203.103 becomes a standby site of ticketA and ticketB.

@dmuhamedagic
Copy link

On Fri, May 30, 2014 at 03:18:05AM -0700, Kazunori INOUE wrote:

This request is a proposal patch about exclusion of the ticket, adds a function which does not grant that ticket to the site specified by exclude_site in booth.conf.

The example for which this function is needed.

  • There are three sites. I want to operate two services (two tickets).
  • However, I want to operate only one service at one site.

Looks like reasonable configuration. I'll comment more on the
patch a bit later.

@phmarek
Copy link

phmarek commented Jun 2, 2014

A simpler way would be to have 2 instances of booth; one with the arbitrator at A, and one with arbitrator B.

Regarding the patch: if you really want to do that,

  • use a bitfield (like the existing site_bits/bitmask) for "allowed" sites within each ticket (initialized to -1, exclude_site removes bits, after reading the config mask all ticket masks again with the site_bits mask)
  • use existing functions, like find_site_by_name, instead of having another strcmp loop
  • at least some of the tests type == SITE will have to be changed to use that per-ticket bitfield now. Perhaps wrap that in an inline function.

That means there's no need for realloc or anything like that - just another value to be initialized, updated, and checked.

@dmuhamedagic
Copy link

On Mon, Jun 02, 2014 at 09:55:26AM -0700, phmarek wrote:

A simpler way would be to have 2 instances of booth; one with the arbitrator at A, and one with arbitrator B.

Yes, that's obviously another solution for this configuration.
Perhaps even preferable to adding another ticket option.
Kazunori-san, would that work for you too?

Regarding the patch: if you really want to do that,

  • use a bitfield (like the existing site_bits/bitmask) for "allowed" sites within each ticket (initialized to -1, exclude_site removes bits, after reading the config mask all ticket masks again with the site_bits mask)

Yes, that's what I also wanted to write today.

  • use existing functions, like find_site_by_name, instead of having another strcmp loop
  • at least some of the tests type == SITE will have to be changed to use that per-ticket bitfield now. Perhaps wrap that in an inline function.

Probably right. I'm also not sure whether the change in
new_election() would suffice and was about to verify the rest of
the code.

@inouekazu
Copy link
Author

Kazunori-san, would that work for you too?

I confirmed that booth had the function we wanted.
So I withdraw this request. Thanks!

@inouekazu inouekazu closed this Jun 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants