[SERVER-37406] A stashed Locker should keep information about the owning transaction Created: 01/Oct/18  Updated: 29/Oct/23  Resolved: 22/Jan/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.1.8, 4.0.15

Type: Improvement Priority: Major - P3
Reporter: Louis Williams Assignee: Xiangyu Yao (Inactive)
Resolution: Fixed Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-42382 add index build UUID to hang analyzer... Closed
related to SERVER-43910 include Client/OpCtx information in L... Closed
is related to SERVER-35900 Refactor transaction machinery out fr... Closed
is related to SERVER-38045 Dump session catalog using GDB scripting Closed
Backwards Compatibility: Fully Compatible
Backport Requested:
v4.0
Sprint: Storage NYC 2019-01-14, Storage NYC 2019-01-28
Participants:
Linked BF Score: 62

 Description   

When the hang analyzer runs, it prints information and address of the LockRequests and Lockers for each thread. If that Locker is owned by an idle, stashed transaction, something like this is printed:

LockRequest 795830 @ 0x7FD023737680: Mode = IX; Thread = thread::id of a non-executing thread

This is pretty useless to a debugger, because the information about which session and transaction own that Locker is not attainable from this output. Instead it requires finding the SessionCatalog and searching through the list of sessions.

When unsetThreadId() is called, we should replace the thread ID with the owning session ID, or just always keep a reference to the session ID on the locker.



 Comments   
Comment by Githook User [ 14/Jan/20 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-37406 Save logical session id in the locker when stashing the transaction

(cherry picked from commit b1830f1ad949059fd7d70cc9490e0216fd30b438)
Branch: v4.0
https://github.com/mongodb/mongo/commit/c0c5a486846f9d0b4a0ee6db6f58df6a127e6da7

Comment by David Bartley [ 10/Jan/20 ]

Yup, that's what we ended up doing for our 4.0 backport of this.

Comment by Benety Goh [ 10/Jan/20 ]

4.0 backport note:

The 4.0 changes for TransactionParticipant should be applied to src/mongo/db/session.cpp because we moved the TxnResources class from Session to TransactionParticipant in SERVER-35900.

Comment by David Bartley [ 07/Dec/19 ]

Could this be backported to 4.0 (see SERVER-37406 and SERVER-43910 for context).

Comment by Githook User [ 22/Jan/19 ]

Author:

{'username': 'xy24', 'email': 'xiangyu.yao@mongodb.com', 'name': 'Xiangyu Yao'}

Message: SERVER-37406 Save logical session id in the locker when stashing the transaction
Branch: master
https://github.com/mongodb/mongo/commit/b1830f1ad949059fd7d70cc9490e0216fd30b438

Generated at Thu Feb 08 04:45:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.