Skip to content

NC | Online Upgrade | Fail config directory upgrade if upgrade is already in progress#8613

Merged
romayalon merged 1 commit into
noobaa:masterfrom
romayalon:romy-online-upgrade-in-progress-upgrade
Dec 19, 2024
Merged

NC | Online Upgrade | Fail config directory upgrade if upgrade is already in progress#8613
romayalon merged 1 commit into
noobaa:masterfrom
romayalon:romy-online-upgrade-in-progress-upgrade

Conversation

@romayalon

@romayalon romayalon commented Dec 18, 2024

Copy link
Copy Markdown
Contributor

Explain the changes

  1. Add a condition in the verification step of the config dir upgrade that checks if there is already in progress upgrade based on system.json.
  2. Added a unit test.

Issues: Fixed #xxx / Gap #xxx

  1. Fixed NC | Online upgrade improvements #8586 partially
  2. Gap - this check still can have a race condition while running config dir upgrade in parallel, this can be improved by using lock - lockfd.fcntllock().

Testing Instructions:

Automatic tests - sudo jest --testRegex=jest_tests/test_nc_upgrade_manager.test.js -t "fail on already in progress upgrade"

Manual test artificially -

  1. Checkout to old branch like 5.16/5.17
  2. run noobaa - sudo node src/cmd/nsfs.js --debug 5, stop noobaa Ctrl+C
  3. Checkout to 5.18 branch
  4. run noobaa - sudo node src/cmd/nsfs.js --debug 5, stop noobaa Ctrl+C
  5. add a delay in NCUpgradeManager for making the upgrade take 2 minutes -
+ const P = require('../util/promise');
....
+ await P.delay(120 * 1000);
   try {
      await this._run_nc_upgrade_scripts(this_upgrade);
  1. run upgrade config dir on tab 1 - noobaa-cli upgrade start --expected_version 5.18.0 --expected_hosts <hostname>
  2. run immediately upgrade config dir on tab 2 - noobaa-cli upgrade start --expected_version 5.18.0 --expected_hosts <hostname> and expect a failure with error message -
 "error": {
    "code": "UpgradeFailed",
    "message": "Upgrade request failed",
    "cause": "Error: config dir upgrade can not be started - there is already an ongoing upgrade system_data.config_directory.in_progess_upgrade .....
  • Doc added/updated
  • Tests added

@shirady shirady left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/test/unit_tests/jest_tests/test_nc_upgrade_manager.test.js Outdated
Comment thread src/test/unit_tests/jest_tests/test_nc_upgrade_manager.test.js
@shirady

shirady commented Dec 19, 2024

Copy link
Copy Markdown
Contributor

@romayalon in the testing instructions (inside the PR description):
Do you open four tabs? (two for the endpoints and two according to steps 6+7), if so could you mention it explicitly in the instructions?

Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
@romayalon romayalon force-pushed the romy-online-upgrade-in-progress-upgrade branch from 68fff65 to 4c8d887 Compare December 19, 2024 08:39
@romayalon

romayalon commented Dec 19, 2024

Copy link
Copy Markdown
Contributor Author

@romayalon in the testing instructions (inside the PR description): Do you open four tabs? (two for the endpoints and two according to steps 6+7), if so could you mention it explicitly in the instructions?

no, I use a tab1 for the upgrade and a second tab for running another config dir upgrade start that I expect to fail.

@romayalon romayalon merged commit 63010a0 into noobaa:master Dec 19, 2024
@romayalon romayalon mentioned this pull request Dec 19, 2024
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NC | Online upgrade improvements

2 participants