Skip to content

squid: mds: only authpin on wrlock when not a locallock#59097

Merged
vshankar merged 1 commit intoceph:squidfrom
batrick:wip-67438-squid
Nov 4, 2024
Merged

squid: mds: only authpin on wrlock when not a locallock#59097
vshankar merged 1 commit intoceph:squidfrom
batrick:wip-67438-squid

Conversation

@batrick
Copy link
Member

@batrick batrick commented Aug 8, 2024

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


backport of #58861
parent tracker: https://tracker.ceph.com/issues/65851

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

For example:

    2024-07-22T21:48:18.372+0000 7f4751a3d700  7 mds.6.server dispatch_client_request client_request(client.4748:62187 create owner_uid=1000, owner_gid=1000 #0x1000000148d/file.mdtest.145.31073 2024-07-22T21:48:18.371416+0000 caller_uid=1000, caller_gid=1000{})
    2024-07-22T21:48:18.372+0000 7f4751a3d700  7 mds.6.server open w/ O_CREAT on #0x1000000148d/file.mdtest.145.31073
    2024-07-22T21:48:18.372+0000 7f4751a3d700 10 mds.6.server rdlock_path_xlock_dentry request(client.4748:62187 nref=2 cr=0x55649752bc00) #0x1000000148d/file.mdtest.145.31073
    2024-07-22T21:48:18.372+0000 7f4751a3d700  7 mds.6.cache traverse: opening base ino 0x1000000148d snap head
    2024-07-22T21:48:18.372+0000 7f4751a3d700 10 mds.6.locker try_rdlock_snap_layout request(client.4748:62187 nref=3 cr=0x55649752bc00) [inode 0x1000000148d [...2,head] /io500/io500/datafiles/2024.07.22-21.44.41/mdtest-easy/test-dir.0-0/mdtest_tree.205.0/ rep@0.1 fragtree_t(*^3) v101539 f(v20 m2024-07-22T21:48:14.075500+0000 30468=30468+0) n(v20 rc2024-07-22T21:48:14.075500+0000 30469=30468+1)/n(v0 rc2024-07-22T21:44:53.839831+0000 155=154+1) (idft lock) (isnap sync r=53) (inest mix w=101 dirty) (ipolicy sync r=53) (ifile mix w=52 dirty) (iquiesce lock w=52 last_client=4748) caps={4748=pAsLsXs/-@30914} | dirtyscattered=2 request=53 lock=5 importing=0 dirfrag=8 caps=1 waiter=0 export_pin=6 0x556494a71b80]
    2024-07-22T21:48:18.372+0000 7f4751a3d700 12 mds.6.cache traverse: path seg depth 0 'file.mdtest.145.31073' snapid head
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.cache.dir(0x1000000148d.011*) lookup (file.mdtest.145.31073, 'head')
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.cache.dir(0x1000000148d.011*)   hit -> (file.mdtest.145.31073,head)
    2024-07-22T21:48:18.372+0000 7f4751a3d700 10 mds.6.locker acquire_locks request(client.4748:62187 nref=3 cr=0x55649752bc00)
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.locker  lov = [LockOp(l=(ifile mix w=52 dirty),f=0x2),LockOp(l=(inest mix w=101 dirty),f=0x2),LockOp(l=(iauth sync),f=0x1),LockOp(l=(dn sync),f=0x4)]
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.locker  auth_pin_nonblocking=0
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.locker  must wrlock (ifile mix w=52 dirty) [inode 0x1000000148d [...2,head] /io500/io500/datafiles/2024.07.22-21.44.41/mdtest-easy/test-dir.0-0/mdtest_tree.205.0/ rep@0.1 fragtree_t(*^3) v101539 f(v20 m2024-07-22T21:48:14.075500+0000 30468=30468+0) n(v20 rc2024-07-22T21:48:14.075500+0000 30469=30468+1)/n(v0 rc2024-07-22T21:44:53.839831+0000 155=154+1) (idft lock) (isnap sync r=53) (inest mix w=101 dirty) (ipolicy sync r=53) (ifile mix w=52 dirty) (iquiesce lock w=52 last_client=4748) caps={4748=pAsLsXs/-@30914} | dirtyscattered=2 request=53 lock=5 importing=0 dirfrag=8 caps=1 waiter=0 export_pin=6 0x556494a71b80]
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.locker need shared quiesce lock for LockOp(l=(ifile mix w=52 dirty),f=0x2) on ifile of 0x556494a71b80
    2024-07-22T21:48:18.372+0000 7f4751a3d700 20 mds.6.locker  must wrlock (iquiesce lock w=52 last_client=4748) [inode 0x1000000148d [...2,head] /io500/io500/datafiles/2024.07.22-21.44.41/mdtest-easy/test-dir.0-0/mdtest_tree.205.0/ rep@0.1 fragtree_t(*^3) v101539 f(v20 m2024-07-22T21:48:14.075500+0000 30468=30468+0) n(v20 rc2024-07-22T21:48:14.075500+0000 30469=30468+1)/n(v0 rc2024-07-22T21:44:53.839831+0000 155=154+1) (idft lock) (isnap sync r=53) (inest mix w=101 dirty) (ipolicy sync r=53) (ifile mix w=52 dirty) (iquiesce lock w=52 last_client=4748) caps={4748=pAsLsXs/-@30914} | dirtyscattered=2 request=53 lock=5 importing=0 dirfrag=8 caps=1 waiter=0 export_pin=6 0x556494a71b80]
    2024-07-22T21:48:18.372+0000 7f4751a3d700 15 mds.6.locker  will also auth_pin [inode 0x1000000148d [...2,head] /io500/io500/datafiles/2024.07.22-21.44.41/mdtest-easy/test-dir.0-0/mdtest_tree.205.0/ rep@0.1 fragtree_t(*^3) v101539 f(v20 m2024-07-22T21:48:14.075500+0000 30468=30468+0) n(v20 rc2024-07-22T21:48:14.075500+0000 30469=30468+1)/n(v0 rc2024-07-22T21:44:53.839831+0000 155=154+1) (idft lock) (isnap sync r=53) (inest mix w=101 dirty) (ipolicy sync r=53) (ifile mix w=52 dirty) (iquiesce lock w=52 last_client=4748) caps={4748=pAsLsXs/-@30914} | dirtyscattered=2 request=53 lock=5 importing=0 dirfrag=8 caps=1 waiter=0 export_pin=6 0x556494a71b80] in case we need to request a scatter

Adding the wrlock on ifile adds iquiesce. Consequently, examining the wrlock on
iquiesce will add an authpin for the inode.

The code for adding authpins on a wrlock should normally no-op because the
xlock which adds the versionlock (dn or inode) already has added the authpin
(and the MDS would be auth for the metadata too). In the case of the
quiescelock, we may not be auth so an authpin can be very expensive and
unnecessary. We only require an authpin for an xlock on the quiescelock when
auth.

Fixes: https://tracker.ceph.com/issues/65851
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 6bfa726)
@batrick batrick added this to the squid milestone Aug 8, 2024
@batrick batrick added the cephfs Ceph File System label Aug 8, 2024
@batrick batrick requested a review from markhpc August 8, 2024 17:16
@batrick
Copy link
Member Author

batrick commented Aug 23, 2024

jenkins test api

@rishabh-d-dave rishabh-d-dave added wip-rishabh-testing Rishabh's testing label wip-rishabh-testing2 and removed wip-rishabh-testing Rishabh's testing label labels Sep 8, 2024
@rishabh-d-dave
Copy link
Contributor

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

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

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

@vshankar vshankar merged commit 8854d08 into ceph:squid Nov 4, 2024
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.

3 participants