[SERVER-41867] CatalogCache::_scheduleDatabaseRefresh/_scheduleCollectionRefresh can try to grab _mutex it already owns Created: 21/Jun/19  Updated: 29/Oct/23  Resolved: 09/Jul/19

Status: Closed
Project: Core Server
Component/s: Sharding
Affects Version/s: 3.6.13, 4.0.10, 4.2.0-rc1
Fix Version/s: 3.6.14, 4.0.11, 4.2.0-rc3, 4.3.1

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Kaloian Manassiev
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v4.2, v4.0, v3.6
Sprint: Sharding 2019-07-15
Participants:

 Description   

_scheduleDatabaseRefresh already holds the _mutex when making this call:

https://github.com/mongodb/mongo/blob/2393ed14199eddebe25e56bc0a8fe1d47f2297cf/src/mongo/s/catalog_cache.cpp#L535

Similarly inside _scheduleCollectionRefresh:

https://github.com/mongodb/mongo/blob/2393ed14199eddebe25e56bc0a8fe1d47f2297cf/src/mongo/s/catalog_cache.cpp#L621



 Comments   
Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Do not reacquire the catalog cache mutex if getChunksSince throws

(cherry picked from commit f7fc5eb7ffd428bfb02ec63abd04898c74d31043)
Branch: v3.6
https://github.com/mongodb/mongo/commit/cdeca00f710c273b4c8e58b31f3506b5cfbbcd0c

Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Do not reacquire the catalog cache mutex if getDatabase/getChunksSince throws

(cherry picked from commit f7fc5eb7ffd428bfb02ec63abd04898c74d31043)
(cherry picked from commit d85ac8993cf7920eea9b7a9d4c1389474a507771)
Branch: v4.0
https://github.com/mongodb/mongo/commit/33dc682131345d3042ca65d3d34dd02e1ee4acbf

Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Make the callbacks chain in `_scheduleDatabaseRefresh` look like `_scheduleCollectionRefresh`

(cherry picked from commit dffab828e9acefe36364ae9db85dbbd0979699e6)
(cherry picked from commit 0c1ada42cd3a0daf86739308339a1e2817ec1362)
Branch: v4.0
https://github.com/mongodb/mongo/commit/272bef85b66f48412c8bd7617857b69cc50087dd

Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Do not reacquire the catalog cache mutex if getDatabase/getChunksSince throws

(cherry picked from commit f7fc5eb7ffd428bfb02ec63abd04898c74d31043)
Branch: v4.2
https://github.com/mongodb/mongo/commit/d85ac8993cf7920eea9b7a9d4c1389474a507771

Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Make the callbacks chain in `_scheduleDatabaseRefresh` look like `_scheduleCollectionRefresh`

(cherry picked from commit dffab828e9acefe36364ae9db85dbbd0979699e6)
Branch: v4.2
https://github.com/mongodb/mongo/commit/0c1ada42cd3a0daf86739308339a1e2817ec1362

Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Do not reacquire the catalog cache mutex if getDatabase/getChunksSince throws
Branch: master
https://github.com/mongodb/mongo/commit/f7fc5eb7ffd428bfb02ec63abd04898c74d31043

Comment by Githook User [ 09/Jul/19 ]

Author:

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

Message: SERVER-41867 Make the callbacks chain in `_scheduleDatabaseRefresh` look like `_scheduleCollectionRefresh`
Branch: master
https://github.com/mongodb/mongo/commit/dffab828e9acefe36364ae9db85dbbd0979699e6

Comment by Randolph Tan [ 21/Jun/19 ]

Note: possibly hard to hit in practice as ThreadPool::schedule has to throw a DBException

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