Skip to content
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

Prevent downgrade when not possible #2858

Merged

Conversation

alexandre-allard
Copy link
Contributor

Component: salt, scripts, downgrade

Context: See #2852 :)

Summary:

Acceptance criteria:


Closes: #2852

@alexandre-allard alexandre-allard requested a review from a team as a code owner October 14, 2020 13:14
@bert-e
Copy link
Contributor

bert-e commented Oct 14, 2020

Hello alexandre-allard-scality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Status report is not available.

@bert-e
Copy link
Contributor

bert-e commented Oct 14, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Oct 14, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@alexandre-allard alexandre-allard changed the title Improvement/2852 prevent downgrade when not possible Prevent downgrade when not possible Oct 14, 2020
@@ -16,6 +18,13 @@ Correct saltenv "{{ saltenv }}" for downgrade to "{{ dest_version }}":

{%- endif %}

{%- if not defaults.downgrade_supported and not pillar.force_downgrade | default(False) %}
Copy link
Contributor Author

@alexandre-allard alexandre-allard Oct 14, 2020

Choose a reason for hiding this comment

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

Maybe we want this pillar entry below the metalk8s one ? pillar.metalk8s.force_downgrade or even something like pillar.metalk8s.downgrade.force ?
Same for defaults, may be downgrade.supported, but I'm not sure the downgrade dict would be useful for anything else in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd put everything under metalk8s.downgrade, either using both .supported and .force, or with a single key, maybe naming it .enabled?

Copy link
Collaborator

Choose a reason for hiding this comment

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

(No strong opinion about the place for force_downgrade but maybe since it's only a pillar key that will be passed to orchestrate I would say to be consistent metalk8s.orchestrate.force_downgrade (or metalk8s.orchestrate.downgrade.force as you want))
Also here the check is wrong I think, because we can downgrade from 2.6.1 to 2.6.0 for example. IMO you should add a check about the destination version here

salt/metalk8s/defaults.yaml Outdated Show resolved Hide resolved
@@ -16,6 +18,13 @@ Correct saltenv "{{ saltenv }}" for downgrade to "{{ dest_version }}":

{%- endif %}

{%- if not defaults.downgrade_supported and not pillar.force_downgrade | default(False) %}
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd put everything under metalk8s.downgrade, either using both .supported and .force, or with a single key, maybe naming it .enabled?

salt/metalk8s/orchestrate/downgrade/precheck.sls Outdated Show resolved Hide resolved
salt/metalk8s/orchestrate/downgrade/precheck.sls Outdated Show resolved Hide resolved
@@ -16,6 +18,13 @@ Correct saltenv "{{ saltenv }}" for downgrade to "{{ dest_version }}":

{%- endif %}

{%- if not defaults.downgrade_supported and not pillar.force_downgrade | default(False) %}
Copy link
Collaborator

Choose a reason for hiding this comment

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

(No strong opinion about the place for force_downgrade but maybe since it's only a pillar key that will be passed to orchestrate I would say to be consistent metalk8s.orchestrate.force_downgrade (or metalk8s.orchestrate.downgrade.force as you want))
Also here the check is wrong I think, because we can downgrade from 2.6.1 to 2.6.0 for example. IMO you should add a check about the destination version here

Comment on lines 108 to 113
# Define if the downgrade from this version is supported.
# It should be set to false if manual operations are needed
# (e.g. downgrade of etcd), prior to downgrading the cluster.
# The downgrade can still be forced setting force_downgrade to True
# in the pillar.
downgrade_supported: false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we really want a pillar key to say downgrade is supported ? Because it's supported from 2.6.1 to 2.6.0 for example but will never be supported from 2.6.x to 2.5.x ... so to me we should just have a check about the version in the precheck

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point

{%- if not defaults.downgrade_supported and not pillar.force_downgrade | default(False) %}

Downgrade from current version is not supported:
test.fail_without_changes
Copy link
Collaborator

Choose a reason for hiding this comment

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

To be clear I would add a clear comment here something like "etcd downgrade not supported blablabla" + Maybe a link to a github issue for this #1750 (maybe we want to do some cleaning in the ticket (and talk about 2.6 instead of non-released 2.3) but no related to this PR)

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd rather link to 2.6.0 release notes, where we will explain this limitation, but agreed, additional help would be very useful for users.

@alexandre-allard alexandre-allard force-pushed the improvement/2852-prevent-downgrade-when-not-possible branch from be085bd to 4c32721 Compare October 22, 2020 10:26
@bert-e
Copy link
Contributor

bert-e commented Oct 22, 2020

History mismatch

Merge commit #a3d20c5c5aa3cb729e2af0ae64ea6b3e32c5a06a on the integration branch
w/2.7/improvement/2852-prevent-downgrade-when-not-possible is merging a branch which is neither the current
branch improvement/2852-prevent-downgrade-when-not-possible nor the development branch
development/2.7.

It is likely due to a rebase of the branch improvement/2852-prevent-downgrade-when-not-possible and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

@alexandre-allard alexandre-allard force-pushed the improvement/2852-prevent-downgrade-when-not-possible branch 2 times, most recently from 4a71f07 to 126332f Compare October 22, 2020 10:30
@alexandre-allard
Copy link
Contributor Author

/reset

@bert-e
Copy link
Contributor

bert-e commented Oct 23, 2020

Reset complete

I have successfully deleted this pull request's integration branches.

@bert-e
Copy link
Contributor

bert-e commented Oct 23, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Oct 23, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@bert-e
Copy link
Contributor

bert-e commented Oct 23, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

Copy link
Contributor

@gdemonet gdemonet left a comment

Choose a reason for hiding this comment

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

LGTM, just a small comment for the message to display in case the downgrade isn't supported.

salt/metalk8s/orchestrate/downgrade/precheck.sls Outdated Show resolved Hide resolved
@bert-e
Copy link
Contributor

bert-e commented Oct 23, 2020

Branches have diverged

This pull request's source branch improvement/2852-prevent-downgrade-when-not-possible has diverged from
development/2.6 by more than 50 commits.

To avoid any integration risks, please re-synchronize them using one of the
following solutions:

  • Merge origin/development/2.6 into improvement/2852-prevent-downgrade-when-not-possible
  • Rebase improvement/2852-prevent-downgrade-when-not-possible onto origin/development/2.6

Note: If you choose to rebase, you may have to ask me to rebuild
integration branches using the reset command.

We now set a boolean in `defaults.yaml` telling if we
support downgrade from a version or not.
It should be set to false if manual operations are needed
(e.g. downgrade of etcd), prior to downgrading the cluster
The cluster can still be force setting
`metalk8s.downgrade.enabled` to `True` in the pillar.
The check will fail early before anything got upgraded
to avoid having an half upgraded cluster situation.

Refs: #2852
This option is used to by-pass the precheck in
downgrade orchestrate, preventing a user from
downgrading for unsupported path.
This is here in case one still want to downgrade
its cluster, for example, if he already has done
some manual operations to ensure the downgrade
will work (e.g. manual downgrade of etcd).

Refs: #2852
@alexandre-allard alexandre-allard force-pushed the improvement/2852-prevent-downgrade-when-not-possible branch from 126332f to 292705b Compare October 26, 2020 10:41
@bert-e
Copy link
Contributor

bert-e commented Oct 26, 2020

History mismatch

Merge commit #d17744acf01c7b674bd0e966f6a25fea51e72a42 on the integration branch
w/2.7/improvement/2852-prevent-downgrade-when-not-possible is merging a branch which is neither the current
branch improvement/2852-prevent-downgrade-when-not-possible nor the development branch
development/2.7.

It is likely due to a rebase of the branch improvement/2852-prevent-downgrade-when-not-possible and the
merge is not possible until all related w/* branches are deleted or updated.

Please use the reset command to have me reinitialize these branches.

@alexandre-allard
Copy link
Contributor Author

/reset

@bert-e
Copy link
Contributor

bert-e commented Oct 26, 2020

Reset complete

I have successfully deleted this pull request's integration branches.

@bert-e
Copy link
Contributor

bert-e commented Oct 26, 2020

Integration data created

I have created the integration data for the additional destination branches.

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

You can set option create_pull_requests if you need me to create
integration pull requests in addition to integration branches, with:

@bert-e create_pull_requests

@bert-e
Copy link
Contributor

bert-e commented Oct 26, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@bert-e
Copy link
Contributor

bert-e commented Oct 26, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

The following reviewers are expecting changes from the author, or must review again:

@bert-e
Copy link
Contributor

bert-e commented Oct 27, 2020

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

@alexandre-allard
Copy link
Contributor Author

/approve

@bert-e
Copy link
Contributor

bert-e commented Oct 27, 2020

Build failed

The build for commit did not succeed in branch w/2.7/improvement/2852-prevent-downgrade-when-not-possible.

The following options are set: approve

Copy link
Collaborator

@TeddyAndrieux TeddyAndrieux left a comment

Choose a reason for hiding this comment

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

Not tested but LGTM

@bert-e
Copy link
Contributor

bert-e commented Oct 28, 2020

In the queue

The changeset has received all authorizations and has been added to the
relevant queue(s). The queue(s) will be merged in the target development
branch(es) as soon as builds have passed.

The changeset will be merged in:

  • ✔️ development/2.6

  • ✔️ development/2.7

The following branches will NOT be impacted:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

There is no action required on your side. You will be notified here once
the changeset has been merged. In the unlikely event that the changeset
fails permanently on the queue, a member of the admin team will
contact you to help resolve the matter.

IMPORTANT

Please do not attempt to modify this pull request.

  • Any commit you add on the source branch will trigger a new cycle after the
    current queue is merged.
  • Any commit you add on one of the integration branches will be lost.

If you need this pull request to be removed from the queue, please contact a
member of the admin team now.

The following options are set: approve

@bert-e
Copy link
Contributor

bert-e commented Oct 28, 2020

I have successfully merged the changeset of this pull request
into targetted development branches:

  • ✔️ development/2.6

  • ✔️ development/2.7

The following branches have NOT changed:

  • development/1.0
  • development/1.1
  • development/1.2
  • development/1.3
  • development/2.0
  • development/2.1
  • development/2.2
  • development/2.3
  • development/2.4
  • development/2.5

Please check the status of the associated issue None.

Goodbye alexandre-allard-scality.

@bert-e bert-e merged commit 211dd07 into development/2.6 Oct 28, 2020
@bert-e bert-e deleted the improvement/2852-prevent-downgrade-when-not-possible branch October 28, 2020 16:03
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.

Prevent user from downgrading when it's not possible (e.g. etcd version change)
4 participants