Skip to content

cephadm: handle "systemctl start" failures during deployment better - #60303

Merged
adk3798 merged 1 commit into
ceph:mainfrom
adk3798:handle-failed-daemon-start
Nov 21, 2024
Merged

adk3798 merged 1 commit into
ceph:mainfrom
adk3798:handle-failed-daemon-start

Conversation

@adk3798

@adk3798 adk3798 commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

Previously it was assumed when the deploy command fails whatever daemon we were trying to deploy does not exist on the host. However, in the specific case where deploy fails trying to start the daemon's systemd unit this is not the case. This leads us to both cleanup the keyring for the daemon and also causes us to not trigger a refresh of the daemons on the host which can make cephadm attempt to deploy another daemon instead of just reporting the existing on as failed. To get around this we need to handle that specific failure as a success in the mgr module's deploy workflow so that we refresh the daemons and report the failure as intended.

https://tracker.ceph.com/issues/68536

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows
  • jenkins test rook e2e

Comment thread src/pybind/mgr/cephadm/serve.py Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this change is going to require updating a whole bunch of unit tests, hence the make check failure

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.

@adk3798 plz, can you give some context about what the purpose of this variable? form its name it's not clear to me what are we capturing here.

BTW: I can't see where the variable is set to another value.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

it defaults to False in both the _run_cephadm and _run_cephadm_json function signatures. If it's True an exception will be thrown if we get a nonzero rc from a cephadm command we run. With it False, it will return the rc, stdout, and stderr even in the case of a nonzero rc. We need it to not throw the exception in order for us to examine the rc from the call and decide whether it's the case this PR is about that needs special handling.

@phlogistonjohn

Copy link
Copy Markdown
Contributor

I was just about to review. I will hold off until you say you've updated the tests.

@adk3798

adk3798 commented Oct 16, 2024

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/phlogistonjohn-2024-10-15_13:29:56-orch:cephadm-wip-adk-testing-2024-10-14-1530-distro-default-smithi/

Failures:

  • 3x failures in smb ctdb tests due to either stray daemon warnings or selinux denials, known issue
  • 3x misc. infra/teuthology failures
  • 3x mds_upgrade sequence timeouts or cluster log warnings, known issue
  • 2x rgw ingress test timeouts, known issue
  • mgr-nfs-upgrade failure, looks like it tried to check all the daemons were upgraded while only the first mgr had been upgraded. It looks like maybe something went wrong with the check to make sure the upgrade had completed.

Would maybe hold off on merging upgrade related PRs, but everything else should be okay.

@phlogistonjohn phlogistonjohn 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.

commit msg reporting the existing on as failed -> `reporting the existing one as failed. It took me a moment to figure out was was meant here. Let's save future readers some time.

.... I looked any way

Comment thread src/cephadm/cephadm.py Resolved
Comment thread src/cephadm/cephadmlib/exceptions.py Resolved
@adk3798
adk3798 force-pushed the handle-failed-daemon-start branch 4 times, most recently from e11fb41 to 092eef1 Compare October 21, 2024 18:39
@adk3798

adk3798 commented Oct 23, 2024

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/adking-2024-10-22_07:55:35-orch:cephadm-wip-adk-testing-2024-10-21-1626-distro-default-smithi/

Failures:

  • 2x smb stdb test SELinux denials / stray daemon warnings, known issue
  • 3x mds_upgrade_sequence in cluster log / timeout issues, known issue
  • 2x rgw-ingress timeout failures, known issue

Nothing to block merging

Previously it was assumed when the deploy command fails whatever
daemon we were trying to deploy does not exist on the host. However,
in the specific case where deploy fails trying to start the daemon's
systemd unit this is not the case. This leads us to both cleanup the
keyring for the daemon and also causes us to not trigger a refresh
of the daemons on the host which can make cephadm attempt to
deploy another daemon instead of just reporting the existing one
as failed. To get around this we need to handle that specific
failure as a success in the mgr module's deploy workflow so that
we refresh the daemons and report the failure as intended.

https://tracker.ceph.com/issues/68536

Signed-off-by: Adam King <[email protected]>
@adk3798
adk3798 force-pushed the handle-failed-daemon-start branch from 092eef1 to 5818305 Compare October 24, 2024 23:14
@phlogistonjohn

Copy link
Copy Markdown
Contributor

jenkins test api

@phlogistonjohn phlogistonjohn 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, thanks

@adk3798

adk3798 commented Oct 28, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test api

Comment thread src/cephadm/cephadm.py
call_throws(ctx, ['systemctl', 'start', unit_name])
except Exception as e:
logger.error(f'systemctl start failed for {unit_name}: {str(e)}')
raise DaemonStartException()

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.

could we use the exception msg e when to create DaemonStartException?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't think it's necessary. The mgr will never see the exception contents since we handle this by just doing a sys.exit() with a specific rc. The only difference would maybe be something added to a traceback in the logs, but I think that's not needed since we're logging the issue right before we raise the exception.

@adk3798

adk3798 commented Oct 29, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test api

@adk3798

adk3798 commented Oct 30, 2024

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/adking-2024-10-30_03:37:52-orch:cephadm-wip-adk-testing-2024-10-29-1832-distro-default-smithi/

Failures:

  • 3x SMB ctdb test stray daemon / SELinux denial, known issue
  • 2x failures on new tests for mgmt-gateway, caused by PR adding those new tests
  • 3x mds_upgrade_sequence failures, known issue
  • 1x staggered upgrade with agent failure, known issue

Dead Jobs:

  • 1x Error reimaging machines, infra/teuthology issue
  • 1x rgw-ingress test timeout, known issue
  • 1x test_iscsi_container timeout. I've seen this before but thought it had been fixed. Will need to investigate.

Results should only block merging for PRs related to iscsi or mgmt-gateqay/oauth2-proxy. Otherwise, run was okay.

@adk3798

adk3798 commented Oct 30, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test api

1 similar comment
@adk3798

adk3798 commented Oct 30, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test api

@adk3798

adk3798 commented Nov 21, 2024

Copy link
Copy Markdown
Contributor Author

https://pulpito.ceph.com/adking-2024-11-19_02:02:13-orch:cephadm-wip-adk-testing-2024-11-18-1758-distro-default-smithi/

Failures:

  • lots of upgrade failures, primarily because the dashboard cherrypy backports issue fix was still not present in reef when these tests ran
  • 1 MON_DOWN cluster log warning, seen this before, need to update the ignoreslist for this test
  • 1 selinux denial failure in an smb ctdb test, known issue
  • 2 new mgmt-gateway tests being added by a PR in the run failed
  • 1 strange failure applying an SMB spec. Seems like it could be a bug that is just rarely hit in that test, as no SMB related PRs were included in the run

I wouldn't merge any SMB changes or the new tests off of this run, but otherwise it's okay.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants