Skip to content

mon: Avoid false stuck peering warning - #65390

Merged
SrinivasaBharath merged 1 commit into
ceph:mainfrom
mohit84:stuck_peering
Dec 2, 2025
Merged

SrinivasaBharath merged 1 commit into
ceph:mainfrom
mohit84:stuck_peering

Conversation

@mohit84

@mohit84 mohit84 commented Sep 4, 2025 •

Copy link
Copy Markdown
Contributor

The stuck peering warning currently depends on last_peered, however last_peered may be stale when a new primary takes over because only the primary updates this value. It can lead to false stuck peering warning even if the PG has only been peering for a few seconds.

Use std::max(last_active, last_peered) when evaluating stuck peering.

Fixes: #https://tracker.ceph.com/issues/72462

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

@mohit84
mohit84 requested a review from a team as a code owner September 4, 2025 13:06
@mohit84

mohit84 commented Sep 4, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@bill-scales

Copy link
Copy Markdown
Contributor

I tested this fix with the test that I added to the tracker https://tracker.ceph.com/issues/72462 and we still get stuck peering messages in the monitor log and health check warnings, so I don't think this change is sufficient. I'll spend a bit of time debugging the log files for the test run to see if I can see where the problem is.

@rzarzynski

Copy link
Copy Markdown
Contributor

@mohit84: ping.

@rzarzynski rzarzynski 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 but delegating the final decision to EC Folks.

@ljflores ljflores left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Given that this patch should address the is stuck peering warnings that come up in teuthology tests, we should consider removing the suppressions from the suite as part of the fix:

$ git grep "is stuck peering" 
qa/cephfs/overrides/pg_health.yaml:      - pg .* is stuck peering
qa/suites/upgrade/reef-x/parallel/0-start.yaml:      - pg .* is stuck peering
qa/suites/upgrade/reef-x/stress-split/1-start.yaml:      - pg .* is stuck peering
qa/suites/upgrade/telemetry-upgrade/reef-x/1-tasks.yaml:      - pg .* is stuck peering
qa/suites/upgrade/telemetry-upgrade/squid-x/1-tasks.yaml:      - pg .* is stuck peering

The stuck peering warning currently depends on last_peered,
however last_peered may be stale when a new primary takes
over because only the primary updates this value. It can
lead to false stuck peering warning even if the PG has
only been peering for a few seconds.

Use std::max(last_active, last_peered) when evaluating
stuck peering.

Updates pg stats during on activation, without this
replicas may continue to report stale state.

Fixes: https://tracker.ceph.com/issues/72462
Signed-off-by: Mohit Agrawal <[email protected]>
@mohit84

mohit84 commented Oct 6, 2025

Copy link
Copy Markdown
Contributor Author

git grep "is stuck peering"

done

@mohit84

mohit84 commented Oct 6, 2025

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@jamiepryde jamiepryde 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

@aainscow aainscow 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

@rzarzynski

Copy link
Copy Markdown
Contributor

jenkins test make check arm64

@ljflores

Copy link
Copy Markdown
Member

@shraddhaag

Copy link
Copy Markdown
Contributor

Hey @mohit84, while analysing: https://tracker.ceph.com/issues/73529, I found a few errors that seem related:

Timeout 120 running ceph --cluster ceph osd out 9
1 jobs: ['8583763']
suites: ['base', 'cluster/{12-osds}', 'ec_optimizations/ec_optimizations_on', 'mem$/{normal-2}', 'mon_election/classic', 'msgr-failures/osd-dispatch-delay', 'objectstore/{bluestore/{alloc$/{bitmap}', 'onode-segment$/{256K}', 'rados', 'rados/thrash-erasure-code-big/{ceph', 'random}}}}', 'recovery-overrides/{more-async-recovery}', 'supported-random-distro$/{ubuntu_latest}', 'thrashers/morepggrow', 'thrashosds-health', 'workloads/ec-rados-plugin=lrc-k=4-m=2-l=3}', 'write$/{random/{compr$/{yes$/{zlib}}']
Timeout 120 running ceph --cluster ceph osd pool create unique_pool_0 16 16 erasure lrcprofile
1 jobs: ['8584148']
suites: ['base', 'cluster/{12-osds}', 'ec_optimizations/ec_optimizations_off', 'mem$/{normal-1}', 'mon_election/connectivity', 'msgr-failures/fastclose', 'objectstore/{bluestore/{alloc$/{bitmap}', 'onode-segment$/{256K}', 'rados', 'rados/thrash-erasure-code-big/{ceph', 'recovery-overrides/{more-active-recovery}', 'supported-random-distro$/{centos_latest}', 'thrashers/mapgap', 'thrashosds-health', 'v1}}}}', 'workloads/ec-rados-plugin=lrc-k=4-m=2-l=3}', 'write$/{v1/{compr$/{yes$/{lz4}}']
Failure: Command failed (workunit test scrub/osd-scrub-repair.sh) on smithi150 with status 1: 'mkdir -p -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && cd -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && CEPH_CLI_TEST_DUP_COMMAND=1 CEPH_REF=653070badbe389507785932e4717c541c90d3423 TESTDIR="/home/ubuntu/cephtest" CEPH_ARGS="--cluster ceph" CEPH_ID="0" PATH=$PATH:/usr/sbin CEPH_BASE=/home/ubuntu/cephtest/clone.client.0 CEPH_ROOT=/home/ubuntu/cephtest/clone.client.0 CEPH_MNT=/home/ubuntu/cephtest/mnt.0 adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 3h /home/ubuntu/cephtest/clone.client.0/qa/standalone/scrub/osd-scrub-repair.sh'
1 jobs: ['8583677']
suites: ['rados/standalone/{supported-random-distro$/{ubuntu_latest}', 'workloads/scrub}']

Could you please check if the errors are related to this PR please?

@mohit84

mohit84 commented Nov 13, 2025

Copy link
Copy Markdown
Contributor Author

Hey @mohit84, while analysing: https://tracker.ceph.com/issues/73529, I found a few errors that seem related:

Timeout 120 running ceph --cluster ceph osd out 9
1 jobs: ['8583763']
suites: ['base', 'cluster/{12-osds}', 'ec_optimizations/ec_optimizations_on', 'mem$/{normal-2}', 'mon_election/classic', 'msgr-failures/osd-dispatch-delay', 'objectstore/{bluestore/{alloc$/{bitmap}', 'onode-segment$/{256K}', 'rados', 'rados/thrash-erasure-code-big/{ceph', 'random}}}}', 'recovery-overrides/{more-async-recovery}', 'supported-random-distro$/{ubuntu_latest}', 'thrashers/morepggrow', 'thrashosds-health', 'workloads/ec-rados-plugin=lrc-k=4-m=2-l=3}', 'write$/{random/{compr$/{yes$/{zlib}}']
Timeout 120 running ceph --cluster ceph osd pool create unique_pool_0 16 16 erasure lrcprofile
1 jobs: ['8584148']
suites: ['base', 'cluster/{12-osds}', 'ec_optimizations/ec_optimizations_off', 'mem$/{normal-1}', 'mon_election/connectivity', 'msgr-failures/fastclose', 'objectstore/{bluestore/{alloc$/{bitmap}', 'onode-segment$/{256K}', 'rados', 'rados/thrash-erasure-code-big/{ceph', 'recovery-overrides/{more-active-recovery}', 'supported-random-distro$/{centos_latest}', 'thrashers/mapgap', 'thrashosds-health', 'v1}}}}', 'workloads/ec-rados-plugin=lrc-k=4-m=2-l=3}', 'write$/{v1/{compr$/{yes$/{lz4}}']
Failure: Command failed (workunit test scrub/osd-scrub-repair.sh) on smithi150 with status 1: 'mkdir -p -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && cd -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && CEPH_CLI_TEST_DUP_COMMAND=1 CEPH_REF=653070badbe389507785932e4717c541c90d3423 TEShe TDIR="/home/ubuntu/cephtest" CEPH_ARGS="--cluster ceph" CEPH_ID="0" PATH=$PATH:/usr/sbin CEPH_BASE=/home/ubuntu/cephtest/clone.client.0 CEPH_ROOT=/home/ubuntu/cephtest/clone.client.0 CEPH_MNT=/home/ubuntu/cephtest/mnt.0 adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 3h /home/ubuntu/cephtest/clone.client.0/qa/standalone/scrub/osd-scrub-repair.sh'
1 jobs: ['8583677']
suites: ['rados/standalone/{supported-random-distro$/{ubuntu_latest}', 'workloads/scrub}']

Could you please check if the errors are related to this PR please?

T

Hey @mohit84, while analysing: https://tracker.ceph.com/issues/73529, I found a few errors that seem related:

Timeout 120 running ceph --cluster ceph osd out 9
1 jobs: ['8583763']
suites: ['base', 'cluster/{12-osds}', 'ec_optimizations/ec_optimizations_on', 'mem$/{normal-2}', 'mon_election/classic', 'msgr-failures/osd-dispatch-delay', 'objectstore/{bluestore/{alloc$/{bitmap}', 'onode-segment$/{256K}', 'rados', 'rados/thrash-erasure-code-big/{ceph', 'random}}}}', 'recovery-overrides/{more-async-recovery}', 'supported-random-distro$/{ubuntu_latest}', 'thrashers/morepggrow', 'thrashosds-health', 'workloads/ec-rados-plugin=lrc-k=4-m=2-l=3}', 'write$/{random/{compr$/{yes$/{zlib}}']
Timeout 120 running ceph --cluster ceph osd pool create unique_pool_0 16 16 erasure lrcprofile
1 jobs: ['8584148']
suites: ['base', 'cluster/{12-osds}', 'ec_optimizations/ec_optimizations_off', 'mem$/{normal-1}', 'mon_election/connectivity', 'msgr-failures/fastclose', 'objectstore/{bluestore/{alloc$/{bitmap}', 'onode-segment$/{256K}', 'rados', 'rados/thrash-erasure-code-big/{ceph', 'recovery-overrides/{more-active-recovery}', 'supported-random-distro$/{centos_latest}', 'thrashers/mapgap', 'thrashosds-health', 'v1}}}}', 'workloads/ec-rados-plugin=lrc-k=4-m=2-l=3}', 'write$/{v1/{compr$/{yes$/{lz4}}']
Failure: Command failed (workunit test scrub/osd-scrub-repair.sh) on smithi150 with status 1: 'mkdir -p -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && cd -- /home/ubuntu/cephtest/mnt.0/client.0/tmp && CEPH_CLI_TEST_DUP_COMMAND=1 CEPH_REF=653070badbe389507785932e4717c541c90d3423 TESTDIR="/home/ubuntu/cephtest" CEPH_ARGS="--cluster ceph" CEPH_ID="0" PATH=$PATH:/usr/sbin CEPH_BASE=/home/ubuntu/cephtest/clone.client.0 CEPH_ROOT=/home/ubuntu/cephtest/clone.client.0 CEPH_MNT=/home/ubuntu/cephtest/mnt.0 adjust-ulimits ceph-coverage /home/ubuntu/cephtest/archive/coverage timeout 3h /home/ubuntu/cephtest/clone.client.0/qa/standalone/scrub/osd-scrub-repair.sh'
1 jobs: ['8583677']
suites: ['rados/standalone/{supported-random-distro$/{ubuntu_latest}', 'workloads/scrub}']

Could you please check if the errors are related to this PR please?

The failures are related to this bug https://tracker.ceph.com/issues/73661 not because of this pr.

@ljflores

Copy link
Copy Markdown
Member

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

Let's bake the fix in main for awhile before backporting.

@shraddhaag

Copy link
Copy Markdown
Contributor

@SrinivasaBharath
SrinivasaBharath merged commit f4e964e into ceph:main Dec 2, 2025
@github-actions

github-actions Bot commented Dec 2, 2025

Copy link
Copy Markdown

This is an automated message by src/script/redmine-upkeep.py.

I have resolved the following tracker ticket due to the merge of this PR:

No backports are pending for the ticket. If this is incorrect, please update the tracker
ticket and reset to Pending Backport state.

Update Log: https://github.com/ceph/ceph/actions/runs/19861314364

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.

9 participants