-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
salt: Store more etcd members informations in pillar (and not use not started etcd) #2099
salt: Store more etcd members informations in pillar (and not use not started etcd) #2099
Conversation
Hello teddyandrieux,My role is to assist you with the merge of this Status report is not available. |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/2.3/bugfix/2083-all-etcd-member-info-in-pillar origin/development/2.3
$ git merge origin/w/2.2/bugfix/2083-all-etcd-member-info-in-pillar
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/2.3/bugfix/2083-all-etcd-member-info-in-pillar |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/2.4/bugfix/2083-all-etcd-member-info-in-pillar origin/development/2.4
$ git merge origin/w/2.3/bugfix/2083-all-etcd-member-info-in-pillar
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/2.4/bugfix/2083-all-etcd-member-info-in-pillar |
StatusStatus report is not available. |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
|
||
{#- Compute the initial state according to the existing list of node. #} | ||
{%- set state = "existing" if etcd_endpoints else "new" %} | ||
{%- set state = "existing" if etcd_members else "new" %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure this is the right approach (though indeed, it's not related to this PR/issue).
In essence, what we're saying here is "If all nodes are unavailable (which causes the member list to be empty), we consider this to be a new cluster", which is definitely not a given. Actually, only during very first bootstrap this can be the case, otherwise we're disaster-recovering or so.
Worth an issue IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it's not a safe approach
#2102
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks, but the functionality looks good to me :)
{%- do etcd_endpoints.update({node_name: endpoint}) %} | ||
|
||
{%- set etcd_initial_cluster = [] %} | ||
{%- for name, ep in etcd_endpoints.items() %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did we really need a second loop over a dict? Do we fear duplicate names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to not break the etcd cluster if we have one node that changed peer urls (since we only support one peer urls here)
Unfortunatly I didn't found any good method to do it without this second loop, if you have an idea do not hesitate
At the beginning just wanted to do something like that in python directly for initial-cluster
','.join('{}={}'.format(name, ip) for name, ip in etcd_endpoints.items())
But not doable in jinja without a custom filter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point was that we're supposed to have a unique set of members (with unique peer_urls, I'd imagine), so we could have just done:
{%- set initial_cluster = [] %}
{%- for member in etcd_members | selectattr('name') %}
{%- do initial_cluster.append(member['name'] ~ '=' ~ member['peer_urls'][0]) %}
{%- endfor %}
{%- do initial_cluster.append(node_name ~ '=' ~ endpoint %}
But it's really minor, and your approach is safer against duplicate values in etcd_members
, so let's leave it as is.
Add all etcd member informations in the pillar retrived from the etcd3 API and use them to compute the `initial-cluster` value for etcd manifest (filtering out the member with empty name) Fixes: #2083
d5e80f4
to
e601ca3
Compare
History mismatchMerge commit #d5e80f46bc208770d8b90af51345b2d05da3f2e9 on the integration branch It is likely due to a rebase of the branch Please use the |
/reset |
Reset completeI have successfully deleted this pull request's integration branches. |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/2.3/bugfix/2083-all-etcd-member-info-in-pillar origin/development/2.3
$ git merge origin/w/2.2/bugfix/2083-all-etcd-member-info-in-pillar
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/2.3/bugfix/2083-all-etcd-member-info-in-pillar |
StatusStatus report is not available. |
ConflictA conflict has been raised during the creation of I have not created the integration branch. Here are the steps to resolve this conflict: $ git fetch
$ git checkout -B w/2.4/bugfix/2083-all-etcd-member-info-in-pillar origin/development/2.4
$ git merge origin/w/2.3/bugfix/2083-all-etcd-member-info-in-pillar
$ # <intense conflict resolution>
$ git commit
$ git push -u origin w/2.4/bugfix/2083-all-etcd-member-info-in-pillar |
Integration data createdI have created the integration data for the additional destination branches.
The following branches will NOT be impacted:
You can set option
|
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
Peer approvals must include at least 1 approval from the following list:
|
{%- do etcd_endpoints.update({node_name: endpoint}) %} | ||
|
||
{%- set etcd_initial_cluster = [] %} | ||
{%- for name, ep in etcd_endpoints.items() %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My point was that we're supposed to have a unique set of members (with unique peer_urls, I'd imagine), so we could have just done:
{%- set initial_cluster = [] %}
{%- for member in etcd_members | selectattr('name') %}
{%- do initial_cluster.append(member['name'] ~ '=' ~ member['peer_urls'][0]) %}
{%- endfor %}
{%- do initial_cluster.append(node_name ~ '=' ~ endpoint %}
But it's really minor, and your approach is safer against duplicate values in etcd_members
, so let's leave it as is.
/approve |
In the queueThe changeset has received all authorizations and has been added to the The changeset will be merged in:
The following branches will NOT be impacted:
There is no action required on your side. You will be notified here once IMPORTANT Please do not attempt to modify this pull request.
If you need this pull request to be removed from the queue, please contact a The following options are set: approve |
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue None. Goodbye teddyandrieux. |
Component:
'salt'
Summary:
Add all etcd member informations in the pillar retrived from the etcd3
API and use them to compute the
initial-cluster
value for etcdmanifest (filtering out the member with empty name)
Fixes: #2083