Skip to content

mds: dump locks when printing mutation ops#52547

Merged
vshankar merged 13 commits intoceph:mainfrom
batrick:i62086
Aug 14, 2023
Merged

mds: dump locks when printing mutation ops#52547
vshankar merged 13 commits intoceph:mainfrom
batrick:i62086

Conversation

@batrick
Copy link
Member

@batrick batrick commented Jul 19, 2023

Looks like:

{
    "ops": [
        {
            "description": "client_request(client.9509:4 setattr size=0 #0x10000000001 2023-07-26T20:12:51.470270-0400 caller_uid=10000, caller_gid=100{10,100,})",
            "initiated_at": "2023-07-26T20:12:51.471588-0400",
            "age": 0.289347825,
            "duration": 0.28939007999999999,
            "type_data": {
                "flag_point": "failed to xlock, waiting",
                "reqid": {
                    "entity": {
                        "type": "client",
                        "num": 9509
                    },
                    "tid": 4
                },
                "op_type": "client_request",
                "events": [
                    {
                        "time": "2023-07-26T20:12:51.471588-0400",
                        "event": "initiated"
                    },
                    {
                        "time": "2023-07-26T20:12:51.471588-0400",
                        "event": "header_read"
                    },
                    {
                        "time": "2023-07-26T20:12:51.471589-0400",
                        "event": "throttled"
                    },
                    {
                        "time": "2023-07-26T20:12:51.471603-0400",
                        "event": "all_read"
                    },
                    {
                        "time": "2023-07-26T20:12:51.471659-0400",
                        "event": "dispatched"
                    },
                    {
                        "time": "2023-07-26T20:12:51.472088-0400",
                        "event": "failed to xlock, waiting"
                    },
                    {
                        "time": "2023-07-26T20:12:51.474317-0400",
                        "event": "failed to xlock, waiting"
                    }
                ],
                "locks": [
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 0,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "dirtyscattered": 1,
                                "request": 0,
                                "lock": 2,
                                "dirfrag": 1,
                                "caps": 1,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "authpin": 0
                            },
                            "nref": 7
                        },
                        "object_string": "[inode 0x1 [...2,head] / auth v61 snaprealm=0x558d682e4b40 DIRTYPARENT f(v0 m2023-07-26T20:11:45.871161-0400 1=0+1) n(v10 rc2023-07-26T20:12:50.363062-0400 3=1+2)/n(v0 rc2023-07-26T20:11:43.884782-0400 1=0+1) (isnap sync r=2) (inest lock w=2 dirty) (iversion lock) caps={9470=pAsLsXsFs/-@2,9499=pAsLsXsFs/-@2,9509=pAsLsXsFs/-@2,9520=pAsLsXsFs/-@2} | dirtyscattered=1 request=0 lock=2 dirfrag=1 caps=1 dirtyparent=1 dirty=1 authpin=0 0x558d68235700]",
                        "lock": {
                            "gather_set": [],
                            "state": "sync",
                            "type": "isnap",
                            "is_leased": false,
                            "num_rdlocks": 2,
                            "num_wrlocks": 0,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 1,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 3,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 0,
                                "lock": 4,
                                "dirfrag": 1,
                                "caps": 1,
                                "dirtyrstat": 0,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "waiter": 0,
                                "authpin": 1
                            },
                            "nref": 9
                        },
                        "object_string": "[inode 0x10000000000 [...2,head] /bar/ auth v968 pv972 ap=3 DIRTYPARENT f(v0 m2023-07-26T20:11:45.926122-0400 1=1+0) n(v0 rc2023-07-26T20:12:50.586902-0400 b1034151 2=1+1) (isnap sync r=2) (inest lock w=3) (ifile lock w=1) (iversion lock w=2) caps={9470=pAsLsXs/pAsLsXsFsx@4,9499=pAsLsXs/pAsLsXsFsx@4,9509=pAsLsXs/pAsLsXsFsx@3,9520=pAsLsXs/pAsLsXsFsx@3} | request=0 lock=4 dirfrag=1 caps=1 dirtyrstat=0 dirtyparent=1 dirty=1 waiter=0 authpin=1 0x558d6d112b00]",
                        "lock": {
                            "gather_set": [],
                            "state": "sync",
                            "type": "isnap",
                            "is_leased": false,
                            "num_rdlocks": 2,
                            "num_wrlocks": 0,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 1,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 6,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "ptrwaiter": 2,
                                "request": 1,
                                "lock": 2,
                                "caps": 1,
                                "truncating": 0,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "waiter": 1,
                                "authpin": 1
                            },
                            "nref": 10
                        },
                        "object_string": "[inode 0x10000000001 [2,head] /bar/test auth v952 pv956 ap=6 DIRTYPARENT s=1034151 n(v0 rc2023-07-26T20:12:50.586902-0400 b1034151 1=1+0) (ifile lock->xlock w=2) (iversion lock) cr={9470=0-4194304@1,9499=0-4194304@1,9509=0-4194304@1} caps={9470=pAsLsXsFcb/pAsxXsxFxwb@16,9499=pAsLsXsFcb/pAsxXsxFxwb@16,9509=pAsLsXsFcb/pAsxXsxFxwb@4,9520=pAsXsFcb/-@1} | ptrwaiter=2 request=1 lock=2 caps=1 truncating=0 dirtyparent=1 dirty=1 waiter=1 authpin=1 0x558d6d113080]",
                        "lock": {
                            "gather_set": [],
                            "state": "sync->lock",
                            "type": "isnap",
                            "is_leased": false,
                            "num_rdlocks": 1,
                            "num_wrlocks": 0,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 1,
                        "wrlock_target": -1
                    }
                ]
            }
        },
        {
            "description": "client_request(client.9520:5 rename #0x10000000000/test.new #0x10000000000/test 2023-07-26T20:12:51.599178-0400 caller_uid=10000, caller_gid=100{10,100,})",
            "initiated_at": "2023-07-26T20:12:51.600355-0400",
            "age": 0.16058003700000001,
            "duration": 0.16084558600000001,
            "type_data": {
                "flag_point": "failed to xlock, waiting",
                "reqid": {
                    "entity": {
                        "type": "client",
                        "num": 9520
                    },
                    "tid": 5
                },
                "op_type": "client_request",
                "events": [
                    {
                        "time": "2023-07-26T20:12:51.600355-0400",
                        "event": "initiated"
                    },
                    {
                        "time": "2023-07-26T20:12:51.600355-0400",
                        "event": "header_read"
                    },
                    {
                        "time": "2023-07-26T20:12:51.600357-0400",
                        "event": "throttled"
                    },
                    {
                        "time": "2023-07-26T20:12:51.600366-0400",
                        "event": "all_read"
                    },
                    {
                        "time": "2023-07-26T20:12:51.600424-0400",
                        "event": "dispatched"
                    },
                    {
                        "time": "2023-07-26T20:12:51.601000-0400",
                        "event": "failed to wrlock, waiting"
                    },
                    {
                        "time": "2023-07-26T20:12:51.601777-0400",
                        "event": "acquired locks"
                    },
                    {
                        "time": "2023-07-26T20:12:51.601908-0400",
                        "event": "failed to xlock, waiting"
                    }
                ],
                "locks": [
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 0,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "dirtyscattered": 1,
                                "request": 0,
                                "lock": 2,
                                "dirfrag": 1,
                                "caps": 1,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "authpin": 0
                            },
                            "nref": 7
                        },
                        "object_string": "[inode 0x1 [...2,head] / auth v61 snaprealm=0x558d682e4b40 DIRTYPARENT f(v0 m2023-07-26T20:11:45.871161-0400 1=0+1) n(v10 rc2023-07-26T20:12:50.363062-0400 3=1+2)/n(v0 rc2023-07-26T20:11:43.884782-0400 1=0+1) (isnap sync r=2) (inest lock w=2 dirty) (iversion lock) caps={9470=pAsLsXsFs/-@2,9499=pAsLsXsFs/-@2,9509=pAsLsXsFs/-@2,9520=pAsLsXsFs/-@2} | dirtyscattered=1 request=0 lock=2 dirfrag=1 caps=1 dirtyparent=1 dirty=1 authpin=0 0x558d68235700]",
                        "lock": {
                            "gather_set": [],
                            "state": "sync",
                            "type": "isnap",
                            "is_leased": false,
                            "num_rdlocks": 2,
                            "num_wrlocks": 0,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 1,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 2,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 1,
                                "lock": 2,
                                "inodepin": 1,
                                "dirty": 1,
                                "authpin": 1
                            },
                            "nref": 6
                        },
                        "object_string": "[dentry #0x1/bar/test [2,head] auth (dn xlock x=1 by 0x558d6d1fc400) (dversion lock w=1 last_client=9520) pv=956 v=952 ap=2 ino=0x10000000001 state=1610612736 | request=1 lock=2 inodepin=1 dirty=1 authpin=1 0x558d6d0d8000]",
                        "lock": {
                            "gather_set": [],
                            "state": "xlock",
                            "type": "dn",
                            "is_leased": false,
                            "num_rdlocks": 0,
                            "num_wrlocks": 0,
                            "num_xlocks": 1,
                            "xlock_by": {
                                "reqid": {
                                    "entity": {
                                        "type": "client",
                                        "num": 9520
                                    },
                                    "tid": 5
                                }
                            }
                        },
                        "flags": 4,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 2,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 1,
                                "lock": 2,
                                "inodepin": 1,
                                "dirty": 1,
                                "authpin": 1
                            },
                            "nref": 6
                        },
                        "object_string": "[dentry #0x1/bar/test [2,head] auth (dn xlock x=1 by 0x558d6d1fc400) (dversion lock w=1 last_client=9520) pv=956 v=952 ap=2 ino=0x10000000001 state=1610612736 | request=1 lock=2 inodepin=1 dirty=1 authpin=1 0x558d6d0d8000]",
                        "lock": {
                            "gather_set": [],
                            "state": "lock",
                            "type": "dversion",
                            "is_leased": false,
                            "num_rdlocks": 0,
                            "num_wrlocks": 1,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 2,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 2,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 1,
                                "lock": 2,
                                "authpin": 1
                            },
                            "nref": 4
                        },
                        "object_string": "[dentry #0x1/bar/test.new [2,head] auth NULL (dn xlock x=1 by 0x558d6d1fc400) (dversion lock w=1 last_client=9520) pv=0 v=957 ap=2 ino=(nil) state=1073741824 | request=1 lock=2 authpin=1 0x558d6d0d8780]",
                        "lock": {
                            "gather_set": [],
                            "state": "xlock",
                            "type": "dn",
                            "is_leased": false,
                            "num_rdlocks": 0,
                            "num_wrlocks": 0,
                            "num_xlocks": 1,
                            "xlock_by": {
                                "reqid": {
                                    "entity": {
                                        "type": "client",
                                        "num": 9520
                                    },
                                    "tid": 5
                                }
                            }
                        },
                        "flags": 4,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 2,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 1,
                                "lock": 2,
                                "authpin": 1
                            },
                            "nref": 4
                        },
                        "object_string": "[dentry #0x1/bar/test.new [2,head] auth NULL (dn xlock x=1 by 0x558d6d1fc400) (dversion lock w=1 last_client=9520) pv=0 v=957 ap=2 ino=(nil) state=1073741824 | request=1 lock=2 authpin=1 0x558d6d0d8780]",
                        "lock": {
                            "gather_set": [],
                            "state": "lock",
                            "type": "dversion",
                            "is_leased": false,
                            "num_rdlocks": 0,
                            "num_wrlocks": 1,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 2,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 3,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 0,
                                "lock": 4,
                                "dirfrag": 1,
                                "caps": 1,
                                "dirtyrstat": 0,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "waiter": 0,
                                "authpin": 1
                            },
                            "nref": 9
                        },
                        "object_string": "[inode 0x10000000000 [...2,head] /bar/ auth v968 pv972 ap=3 DIRTYPARENT f(v0 m2023-07-26T20:11:45.926122-0400 1=1+0) n(v0 rc2023-07-26T20:12:50.586902-0400 b1034151 2=1+1) (isnap sync r=2) (inest lock w=3) (ifile lock w=1) (iversion lock w=2) caps={9470=pAsLsXs/pAsLsXsFsx@4,9499=pAsLsXs/pAsLsXsFsx@4,9509=pAsLsXs/pAsLsXsFsx@3,9520=pAsLsXs/pAsLsXsFsx@3} | request=0 lock=4 dirfrag=1 caps=1 dirtyrstat=0 dirtyparent=1 dirty=1 waiter=0 authpin=1 0x558d6d112b00]",
                        "lock": {
                            "gather_set": [],
                            "state": "lock",
                            "type": "ifile",
                            "is_leased": false,
                            "num_rdlocks": 0,
                            "num_wrlocks": 1,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 2,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 3,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 0,
                                "lock": 4,
                                "dirfrag": 1,
                                "caps": 1,
                                "dirtyrstat": 0,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "waiter": 0,
                                "authpin": 1
                            },
                            "nref": 9
                        },
                        "object_string": "[inode 0x10000000000 [...2,head] /bar/ auth v968 pv972 ap=3 DIRTYPARENT f(v0 m2023-07-26T20:11:45.926122-0400 1=1+0) n(v0 rc2023-07-26T20:12:50.586902-0400 b1034151 2=1+1) (isnap sync r=2) (inest lock w=3) (ifile lock w=1) (iversion lock w=2) caps={9470=pAsLsXs/pAsLsXsFsx@4,9499=pAsLsXs/pAsLsXsFsx@4,9509=pAsLsXs/pAsLsXsFsx@3,9520=pAsLsXs/pAsLsXsFsx@3} | request=0 lock=4 dirfrag=1 caps=1 dirtyrstat=0 dirtyparent=1 dirty=1 waiter=0 authpin=1 0x558d6d112b00]",
                        "lock": {
                            "gather_set": [],
                            "state": "sync",
                            "type": "isnap",
                            "is_leased": false,
                            "num_rdlocks": 2,
                            "num_wrlocks": 0,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 1,
                        "wrlock_target": -1
                    },
                    {
                        "object": {
                            "is_auth": true,
                            "auth_state": {
                                "replicas": {}
                            },
                            "replica_state": {
                                "authority": [
                                    0,
                                    -2
                                ],
                                "replica_nonce": 0
                            },
                            "auth_pins": 3,
                            "is_frozen": false,
                            "is_freezing": false,
                            "pins": {
                                "request": 0,
                                "lock": 4,
                                "dirfrag": 1,
                                "caps": 1,
                                "dirtyrstat": 0,
                                "dirtyparent": 1,
                                "dirty": 1,
                                "waiter": 0,
                                "authpin": 1
                            },
                            "nref": 9
                        },
                        "object_string": "[inode 0x10000000000 [...2,head] /bar/ auth v968 pv972 ap=3 DIRTYPARENT f(v0 m2023-07-26T20:11:45.926122-0400 1=1+0) n(v0 rc2023-07-26T20:12:50.586902-0400 b1034151 2=1+1) (isnap sync r=2) (inest lock w=3) (ifile lock w=1) (iversion lock w=2) caps={9470=pAsLsXs/pAsLsXsFsx@4,9499=pAsLsXs/pAsLsXsFsx@4,9509=pAsLsXs/pAsLsXsFsx@3,9520=pAsLsXs/pAsLsXsFsx@3} | request=0 lock=4 dirfrag=1 caps=1 dirtyrstat=0 dirtyparent=1 dirty=1 waiter=0 authpin=1 0x558d6d112b00]",
                        "lock": {
                            "gather_set": [],
                            "state": "lock",
                            "type": "inest",
                            "is_leased": false,
                            "num_rdlocks": 0,
                            "num_wrlocks": 3,
                            "num_xlocks": 0,
                            "xlock_by": {}
                        },
                        "flags": 2,
                        "wrlock_target": -1
                    }
                ]
            }
        }
    ],
    "num_ops": 2
}

Contribution Guidelines

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

Copy link
Member

@lxbsz lxbsz left a comment

Choose a reason for hiding this comment

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

Verrrrrrry helpful improvements.

@batrick
Copy link
Member Author

batrick commented Jul 20, 2023

Actually, it just occurred to me that this could create infinite recursion due to the "xlock_by" field in the lock. I'll have to think about how we should handle that. Probably, it's a good idea to just print the request string.

@batrick batrick force-pushed the i62086 branch 2 times, most recently from 5a205bd to dca585a Compare July 20, 2023 16:31
@batrick batrick marked this pull request as draft July 22, 2023 11:57
f->open_object_section("xlock_by");
if (get_xlock_by()) {
get_xlock_by()->dump(f);
if (auto mut = get_xlock_by(); mut) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maybe this should just be:

if (auto mut = get_xlock_by(); mut != MutationRef()) {

to avoid dumping just an instance of MutationRef()?

Copy link
Member

Choose a reason for hiding this comment

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

The intrusive pointer MutationRef() should be parsed as nullptr already IMO.

Copy link
Member Author

Choose a reason for hiding this comment

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

I think so too, a null MutationRef() should be boolean false?

Copy link
Member

Choose a reason for hiding this comment

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

yeah.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm.. there are two kinds of checks then - one which checks for nullptr and the other for MutationRef() instance. It's a bit confusing (esp. since its a shared_ptr).

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, you're confusing me Venky. Can you give an example of what you're concerned about?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, you're confusing me Venky. Can you give an example of what you're concerned about?

Ok. I haven't checked this closely, but in some places there is a mix of checks for the value returned by get_xlock_by() - nullptr vs MutationRef() and I wasn't 100% sure if the results of those checks are the same.

@batrick batrick marked this pull request as ready for review July 27, 2023 00:32
@batrick batrick requested a review from a team as a code owner July 27, 2023 00:32
@batrick
Copy link
Member Author

batrick commented Jul 27, 2023

Changes: fairly extensive rework to allow dumping ops while holding the mds_lock. The "ops" asok command now accepts a [flags] argument which specifies additional data to dump (right now, just "locks"). If the user asks for that, then the mds_lock is acquired to safely access to the locks vector.

@github-actions github-actions bot added the tests label Jul 27, 2023
@batrick batrick force-pushed the i62086 branch 3 times, most recently from 56b36e9 to a52fac8 Compare July 27, 2023 14:37
@batrick batrick requested a review from a team as a code owner July 27, 2023 14:37
@github-actions github-actions bot added the rgw label Jul 27, 2023
Copy link
Member

@lxbsz lxbsz left a comment

Choose a reason for hiding this comment

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

LGTM.

@vshankar vshankar self-requested a review August 3, 2023 02:12
@vshankar
Copy link
Contributor

vshankar commented Aug 8, 2023

Integration branch - https://shaman.ceph.com/builds/ceph/wip-vshankar-testing-20230808.093601/

Test runs in ~3 hrs.

@batrick
Copy link
Member Author

batrick commented Aug 8, 2023

@vshankar I just realized there is a stray empty "test" file in the first commit that got added by accident. I'll rebase + remove that.

batrick added 13 commits August 8, 2023 08:58
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
It is not safe to "cache" a member which may be changed by a racing thread.

This reworks the locking so we can do a light-weight check if the description
is already generated wihtout acquiring the heavier TrackedOp::lock. If it's not
available yet or it needs regenerated, then get the proper locks to generate
it.

Fixes: e45f5c2
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Also: fix return to std::string. A string_view is not a thread-safe return.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
The MDS does not generally bother locking a Mutation before changing
anything so this lock provides weak protection. In any case, try to
improve on that...

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
TrackedOp::lock is already suitable for this purpose.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Otherwise you can't easily know which lock it is in the corresponding
MDSCacheObject.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This avoids infinite recursion when dumping locks with xlock_by
non-null.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
When dumping an op, it may be desirable to alter how it is dumped depending on
which locks are held. As it happens, I plan to dump extra information if the
mds_lock is held!

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
For debugging where an operation may be stuck.

Fixes: https://tracker.ceph.com/issues/62086
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
To test they work, not that the output is useful.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
@batrick
Copy link
Member Author

batrick commented Aug 8, 2023

$ git diff 842daeb769b3e1900128f1a20e19a0b57fd2e99e..ca4d0dc42b5
diff --git a/test b/test
deleted file mode 100644
index e69de29bb2d..00000000000

@vshankar
Copy link
Contributor

vshankar commented Aug 9, 2023

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.

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.

3 participants