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 | Health CLI update config directory and upgrade checks #8532

Merged
merged 1 commit into from
Dec 8, 2024

Conversation

romayalon
Copy link
Contributor

@romayalon romayalon commented Nov 14, 2024

Explain the changes

  1. Added a check in the Health CLI that shows the config directory status if exists.
  2. Added a check in the Health CLI that asserts if the upgrade of the config directory has issues, this situation can be discovered by phase of the config directory is locked and there is no ongoing upgrade.
  3. Added unit tests (and did some refactoring).
  4. Fixed a bug that sets the process name to be Upgrade, it's showing in the logs of the endpoint, CLI etc.

Issues: Fixed #xxx / Gap #xxx

  1. Another idea for a health check - check per host if config directory is locked.

Testing Instructions:

  1. sudo node ./node_modules/mocha/bin/mocha src/test/unit_tests/test_nc_health.js
  • Doc added/updated
  • Tests added

@romayalon romayalon force-pushed the romy-online-upgrade-health branch from 89f3503 to 45af106 Compare November 14, 2024 17:49
src/manage_nsfs/health.js Outdated Show resolved Hide resolved
src/manage_nsfs/health.js Outdated Show resolved Hide resolved
src/manage_nsfs/health.js Outdated Show resolved Hide resolved
src/test/unit_tests/test_nc_health.js Show resolved Hide resolved
src/test/unit_tests/test_nc_health.js Outdated Show resolved Hide resolved
src/test/unit_tests/test_nc_health.js Outdated Show resolved Hide resolved
@pull-request-size pull-request-size bot added size/XL and removed size/L labels Dec 5, 2024
@romayalon romayalon force-pushed the romy-online-upgrade-health branch from 26c5f80 to edd1766 Compare December 5, 2024 14:32
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
I added some comments and question which are minor and can be changed in future PRs.

docs/NooBaaNonContainerized/Health.md Outdated Show resolved Hide resolved
const service_health = service_status !== 'active' || pid === '0' || response_code !== 'RUNNING' ? 'NOTOK' : 'OK';

const error_code = await this.get_error_code(service_status, pid, response_code);
const endpoint_response_code = endpoint_state ? endpoint_state.response?.response_code : 'NOT_RUNNING';
Copy link
Contributor

Choose a reason for hiding this comment

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

with this change endpoint_state.response?.response_code we might have endpoint_response_code undefined, do we know how to handle this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it was actually a fix for a bug I saw when running Health CLI while server is down,
I thought about your question and I think that the previous decision to make the default NOT_RUNNING is wrong and it should be UNKNOWN, so I changed it appropiatly.

src/manage_nsfs/health.js Show resolved Hide resolved
src/manage_nsfs/health.js Outdated Show resolved Hide resolved
src/manage_nsfs/health.js Show resolved Hide resolved
src/manage_nsfs/health.js Outdated Show resolved Hide resolved
src/manage_nsfs/health.js Outdated Show resolved Hide resolved
src/test/unit_tests/test_nc_health.js Show resolved Hide resolved
src/test/unit_tests/test_nc_health.js Show resolved Hide resolved
src/test/unit_tests/test_nc_health.js Outdated Show resolved Hide resolved
…checks

Signed-off-by: Romy <35330373+romayalon@users.noreply.github.com>
@romayalon romayalon force-pushed the romy-online-upgrade-health branch from 1742c11 to eaf443f Compare December 8, 2024 15:56
@romayalon romayalon merged commit dee7a5e into noobaa:master Dec 8, 2024
10 checks passed
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.

3 participants