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

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

Merged

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Dec 18, 2024

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

Copy link
Contributor

@shirady shirady left a comment

Choose a reason for hiding this comment

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

LGTM

@shirady
Copy link
Contributor

shirady commented Dec 19, 2024

@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
Copy link
Contributor Author

romayalon commented Dec 19, 2024

@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
10 checks passed
@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