Skip to content

Conversation

@kamoltat
Copy link
Member

@kamoltat kamoltat commented Jan 9, 2024

Problem:

In stretch mode, we encountered
an assert failure when checking for
dead crush zones when we have a none-existing
CRUSH bucket.

Solution:

Ignore the non-existent crush bucket, instead
of asserting. We then warn the user about a particular
MON contains a non-existent CRUSH bucket.
The tiebreaker monitor is the only exception where
we would allow having non-existent Crush location

Fixes: https://tracker.ceph.com/issues/63861

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

@kamoltat kamoltat self-assigned this Jan 9, 2024
@kamoltat kamoltat requested a review from a team as a code owner January 9, 2024 10:44
if (monmap.stretch_mode_enabled) {
for (const auto &p : loc) {
if (!mon.osdmon()->osdmap.crush->name_exists(p.second)) {
ss << "location doesn't belong to any existing crush buckets!"
Copy link
Contributor

@ronen-fr ronen-fr Jan 10, 2024

Choose a reason for hiding this comment

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

One very minor comment:
one long warning line? shouldn't it be broken down into multiple output lines?

Copy link
Member Author

Choose a reason for hiding this comment

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

Several lines above also have one long warning line, IMHO the warning isn't so large that we need multiple lines.

Copy link
Member Author

Choose a reason for hiding this comment

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

nvm I'm changing the output to be shorter, thank you for the review though.

@kamoltat
Copy link
Member Author

jenkins test api

@kamoltat
Copy link
Member Author

jenkins test windows

@ljflores
Copy link
Member

jenkins test api

@ljflores
Copy link
Member

jenkins test api

@ljflores
Copy link
Member

@batrick batrick requested a review from gregsfortytwo January 24, 2024 13:43
if (!mon.osdmon()->osdmap.crush->name_exists(p.second)) {
ss << "location doesn't belong to any existing crush buckets!"
<< " If you are trying to replace an arbiter mon, please use the command:"
<< " ceph mon set_new_tiebreaker";
Copy link
Member

Choose a reason for hiding this comment

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

Don't you need to add the tiebreaker before you can configure it as the tiebreaker? Or did we move that to be a special command to avoid all this?

Copy link
Member Author

Choose a reason for hiding this comment

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

You're right the output is misleading, you need to do ceph mon add and then ceph mon set_new_tiebreaker. I'll just remove that part of the output.

Copy link
Member

Choose a reason for hiding this comment

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

I mean the problem is the tiebreaker monitor's bucket cannot exist in the crush map (or at least, there can't be OSDs there, so having the map reflect it is not idiomatic). And the documentation would need to be changed even if accepting that solution.

Copy link
Member

Choose a reason for hiding this comment

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

And once in stretch mode you are blocked from adding monitors without a location, if that wasn't clear. So this commit actually prevents replacing the tiebreaker at all.

goto reply_no_propose;
}
if (monmap.stretch_mode_enabled) {
for (const auto &p : loc) {
Copy link
Member

Choose a reason for hiding this comment

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

There's a TODO comment several lines up that should be removed if this actually works.

Copy link
Member Author

Choose a reason for hiding this comment

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

Okay will remove that

@gregsfortytwo
Copy link
Member

The documentation certainly still suggests you need to create a monitor and then set it as a tiebreaker.

Which means that since this passed testing, it should also add some tests around that. 😮

@yuriw
Copy link
Contributor

yuriw commented Jan 24, 2024

@kamoltat @gregsfortytwo This was tested ref: https://trello.com/c/79noWWpu
pls merge or add "needs-qa" if more tests needed

@kamoltat
Copy link
Member Author

kamoltat commented Feb 8, 2024

The documentation certainly still suggests you need to create a monitor and then set it as a tiebreaker.

Which means that since this passed testing, it should also add some tests around that. 😮

@gregsfortytwo You're right, I should have added a test to at least qa/standalone. I was just testing the change in vstart.sh. Will create a test for this.

@gregsfortytwo
Copy link
Member

gregsfortytwo commented Feb 8, 2024

The documentation certainly still suggests you need to create a monitor and then set it as a tiebreaker.

Which means that since this passed testing, it should also add some tests around that. 😮

@gregsfortytwo You're right, I should have added a test to at least qa/standalone. I was just testing the change in vstart.sh. Will create a test for this.

How did you test this in vstart? Am I parsing things wrong, given my assumption it actually blocks switching to a new monitor in real deployments?

@kamoltat
Copy link
Member Author

kamoltat commented Feb 9, 2024

@gregsfortytwo I'll test it one more time, been a while since I tested this PR.

@yuriw
Copy link
Contributor

yuriw commented Mar 14, 2024

@kamoltat any update?

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label May 13, 2024
@github-actions
Copy link

This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution!

@github-actions github-actions bot closed this Jun 12, 2024
@kamoltat kamoltat force-pushed the wip-ksirivad-fix-63861 branch 2 times, most recently from 8d446e8 to 10926fd Compare August 8, 2024 21:01
@kamoltat kamoltat requested a review from a team as a code owner August 8, 2024 21:13
@kamoltat
Copy link
Member Author

@gregsfortytwo ping

@kamoltat
Copy link
Member Author

jenkins test make check

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days.
If you are a maintainer or core committer, please follow-up on this pull request to identify what steps should be taken by the author to move this proposed change forward.
If you are the author of this pull request, thank you for your proposed contribution. If you believe this change is still appropriate, please ensure that any feedback has been addressed and ask for a code review.

@github-actions github-actions bot added the stale label Oct 25, 2024
@kamoltat kamoltat removed the stale label Oct 29, 2024
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

Problem:

In a stretch cluster, we encountered
an assert failure when checking for
dead crush zones when we have a none-existing
CRUSH bucket.

Solution:

Ignore the none-existing crush bucket, instead
of assert.

Fixes: https://tracker.ceph.com/issues/63861

Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
Copy link
Member

@gregsfortytwo gregsfortytwo left a comment

Choose a reason for hiding this comment

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

This seems fine
Reviewed-by: Greg Farnum gfarnum@redhat.com

void HealthMonitor::check_mon_crush_loc_stretch_mode(health_check_map_t *checks)
{
// Check if the CRUSH location exists for all MONs
ceph_assert(mon.monmap->stretch_mode_enabled);
Copy link
Member

@gregsfortytwo gregsfortytwo Nov 25, 2024

Choose a reason for hiding this comment

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

Rather than asserting, why not just return (healthy) if stretch mode is off?
I put in a lot of asserts that caused crashes in my first stretch implementation, and assert crashes are better than data corruption, but not being able to fail is even better!

Copy link
Member Author

Choose a reason for hiding this comment

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

The reason I have the assert is because the callee is under the condition:
if (mon.monmap->stretch_mode_enabled)
so if we enter check_mon_crush_loc_stretch_mode and stretch mode is off, then something must have gone wrong. But I understand your point, we can potentially modify this such that we call check_mon_crush_loc_stretch_mode but then exit if stretch mode is not enabled, I can see this being a cleaner approach.

In streth mode, warn the user when
we encounter a MON that
has nonexistent crush location, with
the tiebreaker MON being the only exception to
this.

Fixes: https://tracker.ceph.com/issues/63861

Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
…TRETCH_MODE

Added NONEXISTENT_MON_CRUSH_LOC_STRETCH_MODE to
the documentation.

Fixes: https://tracker.ceph.com/issues/63861

Signed-off-by: Kamoltat Sirivadhna <ksirivad@redhat.com>
@kamoltat kamoltat force-pushed the wip-ksirivad-fix-63861 branch from a9c0abc to 97b815c Compare November 25, 2024 21:55
@kamoltat
Copy link
Member Author

Pushed new change regarding Greg's comment above

@kamoltat
Copy link
Member Author

kamoltat commented Jan 7, 2025

jenkins test make check

@kamoltat
Copy link
Member Author


The CRUSH location specified for the monitor must belong to one of the dividing
buckets when stretch mode is enabled. With the ``tiebreaker`` monitor being the
only exception.
Copy link
Contributor

Choose a reason for hiding this comment

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

Comma not period. The latter part here is not a sentence.

Copy link
Member Author

Choose a reason for hiding this comment

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

@anthonyeleven Ah okay, I guess I'll file a new PR for this.

Copy link
Contributor

Choose a reason for hiding this comment

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

or I can do so, let's get in it while we can.

Copy link
Member Author

Choose a reason for hiding this comment

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

@anthonyeleven okay I think you'll be faster, thank you!

@yuriw yuriw merged commit 5f9fa43 into ceph:main Feb 24, 2025
12 checks passed
zmc pushed a commit to zmc/ceph that referenced this pull request Feb 26, 2025
src/mon/OSDMonitor.cc: [Stretch Mode] WRN non-existent CRUSH location assigned to MON

Reviewed-by: Ronen Friedman <rfriedma@redhat.com>
Reviewed-by: Greg Farnum <gfarnum@redhat.com>
Reviewed-by: Anthony D'Atri <anthony.datri@gmail.com>
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.

7 participants