Skip to content

mon: fix health store size growing infinitely#55347

Merged
yuriw merged 1 commit intoceph:mainfrom
lightmelodies:mon
Feb 12, 2024
Merged

mon: fix health store size growing infinitely#55347
yuriw merged 1 commit intoceph:mainfrom
lightmelodies:mon

Conversation

@lightmelodies
Copy link
Contributor

@lightmelodies lightmelodies commented Jan 29, 2024

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

We have recently encountered MON_DISK_BIG in a large production cluster with all pg active+clean. The paxos log shows that the first committed version of health store stay at 1, while last committed version grows periodically.

2024-01-29T03:01:49.831+0000 7f3260ce3700 10 mon.yj-bstoreceph01rack01meta-01@1(peon).paxosservice(health 1..7481140) refresh
2024-01-29T03:01:49.831+0000 7f3260ce3700 10 mon.yj-bstoreceph01rack01meta-01@1(peon).paxosservice(health 1..7481140) post_refresh
2024-01-29T03:01:50.408+0000 7f3260ce3700 10 mon.yj-bstoreceph01rack01meta-01@1(peon).paxosservice(health 1..7481141) refresh
2024-01-29T03:01:50.408+0000 7f3260ce3700 10 mon.yj-bstoreceph01rack01meta-01@1(peon).paxosservice(health 1..7481141) post_refresh

We then found HealthMonitor::check_mutes wrongly marks changed to true, trigger propose_pending and block following maybe_trim logic (have_pending will be always be false); as a result, the health store will never be trimmed.
This also cause unnecessary paxos propose even no change has been found.

if (check_mutes()) {
changed = true;
}
if (changed) {
propose_pending();
}
}

ceph/src/mon/Monitor.cc

Lines 5892 to 5894 in 93c567e

for (auto& svc : paxos_service) {
svc->tick();
svc->maybe_trim();

void PaxosService::maybe_trim()
{
if (!is_writeable())
return;

ceph/src/mon/PaxosService.h

Lines 548 to 550 in 93c567e

bool is_writeable() const {
return is_active() && have_pending;
}

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

The `check_mutes` wrongly marks `changed` to true, trigger `propose_pending` and block following `maybe_trim` logic (`have_pending` will be always be false); as a result, the health store will never be trimmed.

Signed-off-by: Wei Wang <lightmelodies@outlook.com>
@lightmelodies lightmelodies requested a review from a team as a code owner January 29, 2024 09:18
@lightmelodies
Copy link
Contributor Author

@tchaikov PTAL

@lightmelodies
Copy link
Contributor Author

@cbodley PTAL

Copy link
Contributor

@Matan-B Matan-B left a comment

Choose a reason for hiding this comment

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

LGTM, let's backport this

@Matan-B
Copy link
Contributor

Matan-B commented Feb 6, 2024

jenkins test make check

bool HealthMonitor::check_mutes()
{
bool changed = true;
bool changed = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the intention is clear here.

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.

4 participants