Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Fix bugs with allow-duplicate-installations-on-an-agent. #58

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hgschmie
Copy link
Member

  • Make sure that the config setting is respected everywhere.
  • If less agents than requested installs are present and duplicate installation is allowed, install
    more than one instance of a service per agent.

{
this.coordinator = coordinator;
this.repository = repository;
this.config = config;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Configs are mutable, so the values should be extracted and stored in the constructor

- Make sure that the config setting is respected everywhere.
- If less agents than requested installs are present and duplicate installation is allowed, install
  more than one instance of a service per agent.
@hgschmie
Copy link
Member Author

fixed

}

int totalInstalls = limit;
int installsPerHost = allowDuplicateInstallationsOnAnAgent ? limit / candidateAgents.size() : 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this only works if limit divides evenly into the nodes. For example if you have a target of 10 and 3 nodes you will only get nine installations.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I Presto when doing stuff like this, we use:

candidateAgents = Iterables.limit(Iterables.cycle(candidateAgents), limit);

Once you have that, I think you can simply pass it to the existing logic.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants