[SERVER-13961] Move LockState under OperationContext Created: 15/May/14  Updated: 02/Aug/18  Resolved: 29/Jul/14

Status: Closed
Project: Core Server
Component/s: Concurrency
Affects Version/s: None
Fix Version/s: 2.7.5

Type: Task Priority: Major - P3
Reporter: Kaloian Manassiev Assignee: Kaloian Manassiev
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Gantt Dependency
Related
related to SERVER-14462 db.currentOp doesn't report locking s... Closed
related to SERVER-15120 disk/diskfull.js: Mongod fails to sta... Closed
is related to SERVER-22045 MongoDB should crash if a data file i... Closed
Tested
Participants:
Linked BF Score: 0

 Description   

This change will move LockState under OperationContext, so that it is no longer retrieved from the tread-local state.



 Comments   
Comment by Githook User [ 29/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 RIP Client::lockState()
Branch: master
https://github.com/mongodb/mongo/commit/747176e1ff9943118eb88d102fe7f8f513f001d9

Comment by Githook User [ 28/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass through OperationContext in the JS framework

The JS framework uses DBDirectClient, which requires OperationContext in
order to not conflict with locks, which have already been acquired.

This change also makes dbEval not use pooled scopes and create a new scope
instead.
Branch: master
https://github.com/mongodb/mongo/commit/78d2f38aa445ef1658300e66e1db14b9f1eceba8

Comment by Githook User [ 24/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass more OperationContext down in repl
Branch: master
https://github.com/mongodb/mongo/commit/8b5133c1e2146b3dd015b5f7d2431b586888b07a

Comment by Githook User [ 23/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Thread through OperationContext to the AuthorizationManager
Branch: master
https://github.com/mongodb/mongo/commit/26aff1dcc9a45e72a91a206119c12cc280148175

Comment by Githook User [ 18/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass OperationContext into WhereCallbackReal

There are no functional changes in this commit, just preparation for the
subsequent one, which will add operation context to the JS execution
scope.
Branch: master
https://github.com/mongodb/mongo/commit/9066a06214f115c182c2b83ed40e939e05b9c1f8

Comment by Githook User [ 18/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Cleanup some nested instantiations of OperationContextImpl in repl

These are causing deadlocks if LockState is removed from TLS because of
pseudo-conflicting locks on the same code path.
Branch: master
https://github.com/mongodb/mongo/commit/3c3d656668e26645492ee3dafb241631352426d4

Comment by Githook User [ 10/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Move benchRunner to be in the shell only
Branch: master
https://github.com/mongodb/mongo/commit/af60b4d2d5c1547c6724a2f6437f4c29a74e1470

Comment by Githook User [ 01/Jul/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Add OperationContext argument to Client::Context

Time tracking and database access in Client::Context require access to the
OperationContext. Adding it as argument.

This is in preparation for removing LockState from Client.
Branch: master
https://github.com/mongodb/mongo/commit/f64357e485c8d46bd6fd393f7416df6117672de1

Comment by Githook User [ 30/Jun/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: Revert "SERVER-13961 Add OperationContext argument to Client::Context"

This reverts commit e1f5a39b1b625d04752be13f39c774e579b64cd8.
Branch: master
https://github.com/mongodb/mongo/commit/a353e16805d573af3d5ab4d32fbda87ec98d5c40

Comment by Githook User [ 30/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Add OperationContext argument to Client::Context

Time tracking and database access in Client::Context require access to the
OperationContext. Adding it as argument.

This is in preparation for removing LockState from Client.
Branch: master
https://github.com/mongodb/mongo/commit/e1f5a39b1b625d04752be13f39c774e579b64cd8

Comment by Githook User [ 28/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-13961 Add OperationContext argument to Client::Context"

This reverts commit 52edab726185cbba1401cb46de221fb3d1cb0408.
Branch: master
https://github.com/mongodb/mongo/commit/89fcbab94c7103105e8c72f654a5774a066bdb90

Comment by Githook User [ 28/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Add OperationContext argument to Client::Context

Time tracking and database access in Client::Context require access to the
OperationContext. Adding it as argument.

This is in preparation for removing LockState from Client.
Branch: master
https://github.com/mongodb/mongo/commit/52edab726185cbba1401cb46de221fb3d1cb0408

Comment by Githook User [ 27/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Remove TLS LockState accesses from repl
Branch: master
https://github.com/mongodb/mongo/commit/ecfc44d7bce08660804fa4475b45f9a09d203f09

Comment by Githook User [ 27/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Move clean shutdown logic from dbexit to exitCleanly only

All remaining places, which call dbexit, outside of repl are in response
to unhandled exceptions, so it is not safe to call commit.

The repl calls happen at secondary replica startup time, so no writes
would have happened, so there should not be any data to throw out outside
of replication bookkeeping data.
Branch: master
https://github.com/mongodb/mongo/commit/b9a211782b7ca536ccb6c23b2017434317ca3da3

Comment by Githook User [ 27/Jun/14 ]

Author:

{u'username': u'TylerBrock', u'name': u'Tyler Brock', u'email': u'tyler.brock@gmail.com'}

Message: Revert "SERVER-13961 Remove TLS LockState accesses from repl"

This reverts commit e1dca2cdeed7cf5549a85d487def752d600af244.
Branch: master
https://github.com/mongodb/mongo/commit/8ec5d664cbc47578d01ffb07aa31f32544b1a345

Comment by Githook User [ 26/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Remove TLS LockState accesses from repl
Branch: master
https://github.com/mongodb/mongo/commit/e1dca2cdeed7cf5549a85d487def752d600af244

Comment by Githook User [ 26/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Add capability to register and discover OperationContexts

This replaces the need to iterate through the list of registered Clients
for diagnostics/reporting purposes. Also moves some of the per-client
information to be under OperationContext.

This is in preparation for removing LockState from TLS.
Branch: master
https://github.com/mongodb/mongo/commit/9e93c8d95e7b7fb56f8746fd691b514d7957045f

Comment by Githook User [ 17/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Get rid of some usages of dbexit from deep in sharding code

This change prepares for removing dbexit altogether.
Branch: master
https://github.com/mongodb/mongo/commit/45a0e52f04b7c45072195d03bea50c7a170794d0

Comment by Githook User [ 17/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Get rid of some usages of dbexit from deep in sharding code

This change prepares for removing dbexit altogether.
Branch: master
https://github.com/mongodb/mongo/commit/45a0e52f04b7c45072195d03bea50c7a170794d0

Comment by Githook User [ 13/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Convert most usages of LockState from TLS to OperationContext
Branch: master
https://github.com/mongodb/mongo/commit/15d292461279f3f5cfe077dd2b37a327d75d4c38

Comment by Githook User [ 13/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Add OperationContext to DurableInterface

So we stop using LockState from OperationContext for all durability
operations.
Branch: master
https://github.com/mongodb/mongo/commit/d62e62464bd1bbe1b82c57240e27b1d1700472c4

Comment by Githook User [ 05/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Remove some usages of Lock::isLockedXXX and dbtemprelease

These are the most obvious usages, which do not require any refactoring.
Branch: master
https://github.com/mongodb/mongo/commit/9e6d9d9b6322761df563d2c524a3ba5b7de32949

Comment by Githook User [ 05/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 AuthzSessionExternalStateMongod::startRequest doesn't need a lock check

When called from DBDirectClient, it already skips the check if running
under isGod context.
Branch: master
https://github.com/mongodb/mongo/commit/d1f92647d5c337ce8ec21a60d81adf8de3c140f7

Comment by Githook User [ 03/Jun/14 ]

Author:

{u'username': u'hkhalsa', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}

Message: SERVER-13961 fix struct/class mismatch in cloner
Branch: master
https://github.com/mongodb/mongo/commit/be7ed3e2c03951538554c115b4bbb2d201838118

Comment by Githook User [ 03/Jun/14 ]

Author:

{u'username': u'hkhalsa', u'name': u'Hari Khalsa', u'email': u'hkhalsa@10gen.com'}

Message: SERVER-13961 move repl-specific cloner static methods to where they're used
Branch: master
https://github.com/mongodb/mongo/commit/2ac0d96d7c855f05e5ec20dfad55da5c24ddb826

Comment by Githook User [ 03/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Remove all 'checking' variants of dbHolder

All places which call dbHolder are verifiably under the appropriate lock,
so there is no need to do checking. This allows for the Lock::isLocked
check to be removed from there.
Branch: master
https://github.com/mongodb/mongo/commit/e5da18f2dfbd71fb997734b524e5e4306d0af550

Comment by Githook User [ 03/Jun/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Start using LockState from the OperationContext
Branch: master
https://github.com/mongodb/mongo/commit/8c9fcc939f9f1a2b593e606bd790cc87efd4064f

Comment by Githook User [ 30/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass LockState to DBWrite and DBRead directly

This is part of the changes to move LockState be part of OperationContext
and not retrieved from TLS.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/2729d32c48117386267a5e2a865954283fd26deb

Comment by Githook User [ 30/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass LockState to DBWrite and DBRead directly

This is part of the changes to move LockState be part of OperationContext
and not retrieved from TLS.
Branch: master
https://github.com/mongodb/mongo/commit/4edbe14669b7804180d8b58549e257ceb679bb1d

Comment by Githook User [ 28/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-13961 Pass LockState to DBWrite and DBRead directly"

This reverts commit 4625ce3430892eac2f53b870ca0a24501f3c15f0.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/98b534bc3dd5b6c5806bb937d435957d58374b75

Comment by Githook User [ 28/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: Revert "SERVER-13961 Pass LockState to DBWrite and DBRead directly"

This reverts commit 0672061deb58aac931912bed68d014247c581968.
Branch: master
https://github.com/mongodb/mongo/commit/8bc2783d2e6e39c0910455b4eac9e0f93a482cfc

Comment by Githook User [ 28/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass LockState to DBWrite and DBRead directly

This is part of the changes to move LockState be part of OperationContext
and not retrieved from TLS.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/4625ce3430892eac2f53b870ca0a24501f3c15f0

Comment by Githook User [ 28/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Pass LockState to DBWrite and DBRead directly

This is part of the changes to move LockState be part of OperationContext
and not retrieved from TLS.
Branch: master
https://github.com/mongodb/mongo/commit/0672061deb58aac931912bed68d014247c581968

Comment by Githook User [ 28/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Remove thread-local write intents

This change makes all write intents go straight to the global write
intents list. Cleaning this up is necessary as a step to going to a
per-operation intents list, but it may cause more contention on the global
intents list.
Branch: master
https://github.com/mongodb/mongo/commit/ee3fb776c7f36d59b593db7e4165b0611a7a503f

Comment by Ramon Fernandez Marina [ 20/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Remove dependency on the TLS client from LockState

Also clean-up some of the code under LockState, in preparation from moving
it under operation context.
Branch: master
https://github.com/mongodb/mongo/commit/9823bc1393f71baff06e6bb2d711c628eb7015bf

Comment by Githook User [ 16/May/14 ]

Author:

{u'username': u'kaloianm', u'name': u'Kaloian Manassiev', u'email': u'kaloian.manassiev@mongodb.com'}

Message: SERVER-13961 Get rid of the DB_LEVEL_LOCKING_ENABLED macro

We will no loger build with global locking on.
Branch: master
https://github.com/mongodb/mongo/commit/9bac8024b68ef97aaa0ffaa868ee783fe793f54a

Generated at Thu Feb 08 03:33:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.