Skip to content

Conversation

@xeniape
Copy link
Member

@xeniape xeniape commented Apr 7, 2025

Description

Implementation of #736
This PR configures the rolling upgrade for clusters upgrading from version 2.x to 2.y. It also expands the upgrade integration test.

--- PASS: kuttl (2670.97s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/logging_nifi-1.27.0_zookeeper-latest-3.9.3_openshift-false (184.85s)
        --- PASS: kuttl/harness/ldap_nifi-2.2.0_zookeeper-latest-3.9.3_ldap-use-tls-false_openshift-false (185.65s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.3_openshift-false_listener-class-external-unstable (252.70s)
        --- PASS: kuttl/harness/cluster_operation_nifi-latest-2.2.0_zookeeper-latest-3.9.3_openshift-false (91.17s)
        --- PASS: kuttl/harness/resources_nifi-2.2.0_zookeeper-latest-3.9.3_openshift-false (84.79s)
        --- PASS: kuttl/harness/resources_nifi-1.27.0_zookeeper-latest-3.9.3_openshift-false (199.67s)
        --- PASS: kuttl/harness/resources_nifi-1.28.1_zookeeper-latest-3.9.3_openshift-false (230.88s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.3_openshift-false_listener-class-cluster-internal (273.97s)
        --- PASS: kuttl/harness/upgrade_nifi_old-1.27.0_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-false (375.19s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.2_openshift-false_listener-class-external-unstable (250.60s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.2_openshift-false_listener-class-cluster-internal (266.33s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.3_openshift-false_listener-class-external-unstable (264.48s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.3_openshift-false_listener-class-cluster-internal (244.04s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.2_openshift-false_listener-class-external-unstable (229.98s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.2_openshift-false_listener-class-cluster-internal (256.39s)
        --- PASS: kuttl/harness/orphaned_resources_nifi-2.2.0_zookeeper-latest-3.9.3_openshift-false (74.50s)
        --- PASS: kuttl/harness/upgrade_nifi_old-2.0.0_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-false (341.71s)
        --- PASS: kuttl/harness/orphaned_resources_nifi-1.28.1_zookeeper-latest-3.9.3_openshift-false (222.26s)
        --- PASS: kuttl/harness/ldap_nifi-1.28.1_zookeeper-latest-3.9.3_ldap-use-tls-false_openshift-false (192.22s)
        --- PASS: kuttl/harness/ldap_nifi-1.28.1_zookeeper-latest-3.9.3_ldap-use-tls-true_openshift-false (193.35s)
        --- PASS: kuttl/harness/ldap_nifi-1.27.0_zookeeper-latest-3.9.3_ldap-use-tls-true_openshift-false (181.43s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.3_openshift-false_listener-class-cluster-internal (393.69s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.3_openshift-false_listener-class-external-unstable (308.61s)
        --- PASS: kuttl/harness/oidc_nifi-1.28.1_zookeeper-latest-3.9.3_oidc-use-tls-false_openshift-false (103.77s)
        --- PASS: kuttl/harness/ldap_nifi-1.27.0_zookeeper-latest-3.9.3_ldap-use-tls-false_openshift-false (185.14s)
        --- PASS: kuttl/harness/oidc_nifi-1.27.0_zookeeper-latest-3.9.3_oidc-use-tls-false_openshift-false (102.90s)
        --- PASS: kuttl/harness/oidc_nifi-2.2.0_zookeeper-latest-3.9.3_oidc-use-tls-true_openshift-false (86.37s)
        --- PASS: kuttl/harness/oidc_nifi-2.2.0_zookeeper-latest-3.9.3_oidc-use-tls-false_openshift-false (87.73s)
        --- PASS: kuttl/harness/oidc_nifi-1.27.0_zookeeper-latest-3.9.3_oidc-use-tls-true_openshift-false (106.12s)
        --- PASS: kuttl/harness/oidc_nifi-1.28.1_zookeeper-latest-3.9.3_oidc-use-tls-true_openshift-false (112.98s)
        --- PASS: kuttl/harness/logging_nifi-2.2.0_zookeeper-latest-3.9.3_openshift-false (96.08s)
        --- PASS: kuttl/harness/orphaned_resources_nifi-1.27.0_zookeeper-latest-3.9.3_openshift-false (235.80s)
        --- PASS: kuttl/harness/logging_nifi-1.28.1_zookeeper-latest-3.9.3_openshift-false (177.56s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.2_openshift-false_listener-class-external-unstable (319.63s)
        --- PASS: kuttl/harness/ldap_nifi-2.2.0_zookeeper-latest-3.9.3_ldap-use-tls-true_openshift-false (173.58s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.2_openshift-false_listener-class-cluster-internal (419.51s)
PASS

The upgrade_nifi_old-2.0.0_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-false integration test was run with a custom built nifi image 2.0.0-stackable0.0.0-dev since we currently don't have a release with two separate nifi 2.x versions. If this changes, the tests will need some adjustments, for example in test-definition.yaml for the nifi_old dimension. This is currently left out to not break current test runs.

Openshift Tests:

--- PASS: kuttl (780.82s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/upgrade_nifi_old-1.27.0_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-true (383.02s)
        --- PASS: kuttl/harness/upgrade_nifi_old-2.0.0,docker.stackable.tech_sandbox_nifi_2.0.0-stackable0.0.0-dev_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-true (397.46s)
PASS

Definition of Done Checklist

  • Not all of these items are applicable to all PRs, the author should update this template to only leave the boxes in that are relevant
  • Please make sure all these things are done and tick the boxes
# Author
- [x] Changes are OpenShift compatible
- [ ] CRD changes approved
- [ ] CRD documentation for all fields, following the [style guide](https://docs.stackable.tech/home/nightly/contributor/docs/style-guide).
- [x] Helm chart can be installed and deployed operator works
- [x] Integration tests passed (for non trivial changes)
- [x] Changes need to be "offline" compatible
# Reviewer
- [ ] Code contains useful comments
- [ ] Code contains useful logging statements
- [x] (Integration-)Test cases added
- [x] Documentation added or updated. Follows the [style guide](https://docs.stackable.tech/home/nightly/contributor/docs/style-guide).
- [x] Changelog updated
- [x] Cargo.toml only contains references to git tags (not specific commits or branches)
# Acceptance
- [ ] Feature Tracker has been updated
- [ ] Proper release label has been added
- [ ] [Roadmap](https://github.com/orgs/stackabletech/projects/25/views/1) has been updated

@xeniape xeniape self-assigned this Apr 7, 2025
@xeniape xeniape linked an issue Apr 7, 2025 that may be closed by this pull request
@xeniape xeniape marked this pull request as ready for review April 8, 2025 09:41
@maltesander maltesander self-requested a review April 9, 2025 13:03
Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

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

Tests work fine, flows keep working (and running) from 1.27.0 to 2.0.0 to 2.2.0 and displays accordingly
Screenshot from 2025-04-09 16-51-19

There is one problem when i tried with the custom 2.0.0 image to the standard 2.2.0. When using a non custom image afterwards and no serverside apply the propery is still set. This then showed the nifi version in the UI to be 2.0.0 (but using 2.2.0 image).
This should be fixed in 02-install-nifi.yaml.j2 like:

spec:
  image:
{% if test_scenario['values']['nifi_old'].find(",") > 0 %}
    custom: "{{ test_scenario['values']['nifi_old'].split(',')[1] }}"
    productVersion: "{{ test_scenario['values']['nifi_old'].split(',')[0] }}"
{% else %}
    productVersion: "{{ test_scenario['values']['nifi_old'] }}"
    custom: null 
{% endif %}

and in 05-upgrade-nifi.yaml.j2 like

{% if test_scenario['values']['nifi_new'].find(",") > 0 %}
    custom: "{{ test_scenario['values']['nifi_new'].split(',')[1] }}"
    productVersion: "{{ test_scenario['values']['nifi_new'].split(',')[0] }}"
{% else %}
    productVersion: "{{ test_scenario['values']['nifi_new'] }}"
    custom: null # <-----thats required
{% endif %}

@xeniape
Copy link
Member Author

xeniape commented Apr 10, 2025

Tests work fine, flows keep working (and running) from 1.27.0 to 2.0.0 to 2.2.0 and displays accordingly Screenshot from 2025-04-09 16-51-19

There is one problem when i tried with the custom 2.0.0 image to the standard 2.2.0. When using a non custom image afterwards and no serverside apply the propery is still set. This then showed the nifi version in the UI to be 2.0.0 (but using 2.2.0 image). This should be fixed in 02-install-nifi.yaml.j2 like:

spec:
  image:
{% if test_scenario['values']['nifi_old'].find(",") > 0 %}
    custom: "{{ test_scenario['values']['nifi_old'].split(',')[1] }}"
    productVersion: "{{ test_scenario['values']['nifi_old'].split(',')[0] }}"
{% else %}
    productVersion: "{{ test_scenario['values']['nifi_old'] }}"
    custom: null 
{% endif %}

and in 05-upgrade-nifi.yaml.j2 like

{% if test_scenario['values']['nifi_new'].find(",") > 0 %}
    custom: "{{ test_scenario['values']['nifi_new'].split(',')[1] }}"
    productVersion: "{{ test_scenario['values']['nifi_new'].split(',')[0] }}"
{% else %}
    productVersion: "{{ test_scenario['values']['nifi_new'] }}"
    custom: null # <-----thats required
{% endif %}

Good find, thanks! Added the fix in all the integration tests 8b20f2a

Also reran an affected test:

--- PASS: kuttl (408.70s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/upgrade_nifi_old-2.0.0,docker.stackable.tech_sandbox_nifi_2.0.0-stackable0.0.0-dev_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-false (408.69s)
PASS

@xeniape
Copy link
Member Author

xeniape commented Apr 10, 2025

Integration tests rerun after all the new changes:

--- PASS: kuttl (2841.12s)
    --- PASS: kuttl/harness (0.00s)
        --- PASS: kuttl/harness/oidc_nifi-1.27.0_zookeeper-latest-3.9.3_oidc-use-tls-false_openshift-false (232.20s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.2_openshift-false_listener-class-cluster-internal (294.83s)
        --- PASS: kuttl/harness/oidc_nifi-2.2.0_zookeeper-latest-3.9.3_oidc-use-tls-true_openshift-false (86.09s)
        --- PASS: kuttl/harness/ldap_nifi-1.28.1_zookeeper-latest-3.9.3_ldap-use-tls-true_openshift-false (402.46s)
        --- PASS: kuttl/harness/oidc_nifi-2.2.0_zookeeper-latest-3.9.3_oidc-use-tls-false_openshift-false (87.20s)
        --- PASS: kuttl/harness/oidc_nifi-1.28.1_zookeeper-latest-3.9.3_oidc-use-tls-true_openshift-false (105.08s)
        --- PASS: kuttl/harness/oidc_nifi-1.28.1_zookeeper-latest-3.9.3_oidc-use-tls-false_openshift-false (107.49s)
        --- PASS: kuttl/harness/oidc_nifi-1.27.0_zookeeper-latest-3.9.3_oidc-use-tls-true_openshift-false (108.50s)
        --- PASS: kuttl/harness/cluster_operation_nifi-latest-2.2.0_zookeeper-latest-3.9.3_openshift-false (392.43s)
        --- PASS: kuttl/harness/ldap_nifi-1.28.1_zookeeper-latest-3.9.3_ldap-use-tls-false_openshift-false (186.80s)
        --- PASS: kuttl/harness/ldap_nifi-1.27.0_zookeeper-latest-3.9.3_ldap-use-tls-true_openshift-false (192.46s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.3_openshift-false_listener-class-external-unstable (298.46s)
        --- PASS: kuttl/harness/orphaned_resources_nifi-2.2.0_zookeeper-latest-3.9.3_openshift-false (75.29s)
        --- PASS: kuttl/harness/orphaned_resources_nifi-1.28.1_zookeeper-latest-3.9.3_openshift-false (167.80s)
        --- PASS: kuttl/harness/ldap_nifi-1.27.0_zookeeper-latest-3.9.3_ldap-use-tls-false_openshift-false (270.79s)
        --- PASS: kuttl/harness/logging_nifi-2.2.0_zookeeper-latest-3.9.3_openshift-false (133.38s)
        --- PASS: kuttl/harness/orphaned_resources_nifi-1.27.0_zookeeper-latest-3.9.3_openshift-false (282.95s)
        --- PASS: kuttl/harness/logging_nifi-1.28.1_zookeeper-latest-3.9.3_openshift-false (185.58s)
        --- PASS: kuttl/harness/resources_nifi-2.2.0_zookeeper-latest-3.9.3_openshift-false (83.69s)
        --- PASS: kuttl/harness/logging_nifi-1.27.0_zookeeper-latest-3.9.3_openshift-false (199.55s)
        --- PASS: kuttl/harness/resources_nifi-1.28.1_zookeeper-latest-3.9.3_openshift-false (226.48s)
        --- PASS: kuttl/harness/resources_nifi-1.27.0_zookeeper-latest-3.9.3_openshift-false (229.93s)
        --- PASS: kuttl/harness/upgrade_nifi_old-2.0.0,docker.stackable.tech_sandbox_nifi_2.0.0-stackable0.0.0-dev_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-false (511.93s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.3_openshift-false_listener-class-cluster-internal (241.56s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.3_openshift-false_listener-class-cluster-internal (325.74s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.2_openshift-false_listener-class-external-unstable (310.27s)
        --- PASS: kuttl/harness/ldap_nifi-2.2.0_zookeeper-latest-3.9.3_ldap-use-tls-true_openshift-false (177.33s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.3_openshift-false_listener-class-external-unstable (245.96s)
        --- PASS: kuttl/harness/smoke_nifi-2.2.0_zookeeper-3.9.2_openshift-false_listener-class-cluster-internal (420.34s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.3_openshift-false_listener-class-external-unstable (240.72s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.2_openshift-false_listener-class-external-unstable (262.67s)
        --- PASS: kuttl/harness/upgrade_nifi_old-1.27.0_nifi_new-2.2.0_zookeeper-latest-3.9.3_openshift-false (357.16s)
        --- PASS: kuttl/harness/smoke_nifi-1.28.1_zookeeper-3.9.2_openshift-false_listener-class-cluster-internal (242.29s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.3_openshift-false_listener-class-cluster-internal (254.12s)
        --- PASS: kuttl/harness/smoke_nifi-1.27.0_zookeeper-3.9.2_openshift-false_listener-class-external-unstable (252.19s)
        --- PASS: kuttl/harness/ldap_nifi-2.2.0_zookeeper-latest-3.9.3_ldap-use-tls-false_openshift-false (181.66s)
PASS

@xeniape xeniape requested a review from maltesander April 10, 2025 14:38
Copy link
Member

@maltesander maltesander left a comment

Choose a reason for hiding this comment

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

LGTM!

@xeniape xeniape added this pull request to the merge queue Apr 10, 2025
github-merge-queue bot pushed a commit that referenced this pull request Apr 10, 2025
* feat: add rolling upgrade support for nifi 2.x

* cargo fmt

* cargo fmt

* cargo update and make regenerate-nix

* add changelog entry

* add documentation

* cargo update and make regenerate-nix

* fix upgrade intergration tests with custom images

* cargo update and make regenerate-nix

* fix integration tests when using custom images

* rename VersionChangeState enum and some variants

* rename enum variant

* move upgrade code in separate module

* cargo fmt

* adapt variable names

---------

Co-authored-by: Malte Sander <malte.sander.it@gmail.com>
Merged via the queue into main with commit 6bcd098 Apr 10, 2025
17 checks passed
@xeniape xeniape deleted the feat/rolling-upgrade-support branch April 10, 2025 14:55
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.

Rolling Upgrade support https://issues.apache.org/jira/browse/NIFI-13659

3 participants