Skip to content

quincy: mds: use regular dispatch for processing beacons#57684

Closed
batrick wants to merge 4 commits intoceph:quincyfrom
batrick:wip-66195-quincy
Closed

quincy: mds: use regular dispatch for processing beacons#57684
batrick wants to merge 4 commits intoceph:quincyfrom
batrick:wip-66195-quincy

Conversation

@batrick
Copy link
Member

@batrick batrick commented May 23, 2024

backport tracker: https://tracker.ceph.com/issues/66195


backport of #57469
parent tracker: https://tracker.ceph.com/issues/66014

this backport was staged using ceph-backport.sh version 16.0.0.6848
find the latest version at https://github.com/ceph/ceph/blob/main/src/script/ceph-backport.sh

@batrick batrick requested a review from a team as a code owner May 23, 2024 19:39
@batrick batrick added this to the quincy milestone May 23, 2024
@batrick batrick added the cephfs Ceph File System label May 23, 2024
@lxbsz
Copy link
Member

lxbsz commented Aug 2, 2024

This PR is under test in https://tracker.ceph.com/issues/67315.

@batrick
Copy link
Member Author

batrick commented Dec 30, 2024

jenkins test make check

@ceph ceph deleted a comment from github-actions bot Dec 30, 2024
@vshankar
Copy link
Contributor

vshankar commented Jan 2, 2025

This PR is under test in https://tracker.ceph.com/issues/69400.

For order checking.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 1b93fd5)
So we can ensure that e.g. MDSRank::ms_dispatch is lowest priority so that we
do not acquire the mds_lock when looking at beacons.

This change maintains the current behavior when the priority is unset: the use
of std::stable_sort will ensure that the add_dispatcher_head and
add_dispatcher_tail calls will preserve order when dispatcher priorities are
equal.

Fixes: 7fc04be
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit b463d93)
Similar to the issue with MClientMetrics, beacons should also not be handled
via fast dispatch because it's necessary to acquire Beacon::mutex. This is a
big no-no as it may block one of the Messenger threads leading to improbable
deadlocks or DoS.

Instead, use the normal dispatch where acquiring locks is okay to do.

Fixes: 7fc04be
See-also: linux.git/f7c2f4f6ce16fb58f7d024f3e1b40023c4b43ff9
Fixes: https://tracker.ceph.com/issues/65658

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7fc2a65)
This tries to preserve existing order but uses priorities to make it explicit
and robust to future dispatchers being added. Except:

- The beacon and metrics dispatcher have the highest priorities.  This is to
  ensure we process these messages before trying to acquire any expensive locks
  (like mds_lock).

- The monc dispatcher also has a relatively high priority for the same reasons.
  This change affects other daemons which may have ordered a dispatcher ahead
  of the monc but I cannot think of a legitimate reason to nor do I see an
  instance of it.

Fixes: 7fc04be
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 3291f39)
@vshankar
Copy link
Contributor

Quincy is EOL.

@vshankar vshankar closed this Feb 11, 2025
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.

4 participants