[SERVER-6948] Can't call commitIfNeeded in DBDirectClient::call if not write-locked Created: 05/Sep/12  Updated: 11/Jul/16  Resolved: 10/Sep/12

Status: Closed
Project: Core Server
Component/s: Stability
Affects Version/s: 2.2.0
Fix Version/s: 2.2.1, 2.3.0

Type: Bug Priority: Major - P3
Reporter: Mathias Stearn Assignee: Mathias Stearn
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

This fassert is caused by using $where (note the Scope::loadStored call in the stack). It looks like the calls to commitIfNeeded in the DBDirectClient class should be conditional on the type of lock held to avoid this assert.

Fatal Assertion 16110
0xade6e1 0x802e03 0xa07e7b 0xa0a226 0xa0a83a 0xa081b6 0xa0835c 0xb5eb60 0x6f698d 0xa90c3a 0xb506b6 0x786972 0xbce39c 0x929481 0x928abc 0xa0e287 0xa0ed48 0x84e39d 0x84e6e9 0x6ac10e 
 /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xade6e1]
 /usr/bin/mongod(_ZN5mongo13fassertFailedEi+0xa3) [0x802e03]
 /usr/bin/mongod(_ZN5mongo3dur25assertLockedForCommittingEv+0x1b) [0xa07e7b]
 /usr/bin/mongod() [0xa0a226]
 /usr/bin/mongod(_ZN5mongo3dur11DurableImpl9commitNowEv+0x1a) [0xa0a83a]
 /usr/bin/mongod(_ZN5mongo3dur11DurableImpl16_aCommitIsNeededEv+0x66) [0xa081b6]
 /usr/bin/mongod(_ZN5mongo3dur11DurableImpl14commitIfNeededEb+0x4c) [0xa0835c]
 /usr/bin/mongod(_ZN5mongo14DBDirectClient4callERNS_7MessageES2_bPSs+0x290) [0xb5eb60]
 /usr/bin/mongod(_ZN5mongo14DBClientCursor4initEv+0xbd) [0x6f698d]
 /usr/bin/mongod(_ZN5mongo12DBClientBase5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii+0xea) [0xa90c3a]
 /usr/bin/mongod(_ZN5mongo14DBDirectClient5queryERKSsNS_5QueryEiiPKNS_7BSONObjEii+0x56) [0xb506b6]
 /usr/bin/mongod(_ZN5mongo5Scope10loadStoredEb+0xf2) [0x786972]
 /usr/bin/mongod(_ZN5mongo7SMScope12localConnectEPKc+0x1ec) [0xbce39c]
 /usr/bin/mongod(_ZN5mongo5Where4initEv+0x121) [0x929481]
 /usr/bin/mongod(_ZNK5mongo7Matcher7matchesERKNS_7BSONObjEPNS_12MatchDetailsE+0x118c) [0x928abc]
 /usr/bin/mongod(_ZNK5mongo19CoveredIndexMatcher7matchesERKNS_7BSONObjERKNS_7DiskLocEPNS_12MatchDetailsEb+0xc7) [0xa0e287]
 /usr/bin/mongod(_ZNK5mongo19CoveredIndexMatcher14matchesCurrentEPNS_6CursorEPNS_12MatchDetailsE+0xa8) [0xa0ed48]
 /usr/bin/mongod(_ZN5mongo22QueryOptimizerCursorOp14currentMatchesEPNS_12MatchDetailsE+0xad) [0x84e39d]
 /usr/bin/mongod(_ZN5mongo24QueryOptimizerCursorImpl14currentMatchesEPNS_12MatchDetailsE+0x79) [0x84e6e9]
 /usr/bin/mongod(_ZN5mongo20QueryResponseBuilder14currentMatchesERNS_12MatchDetailsE+0x1e) [0x6ac10e]
Wed Sep  5 09:49:26 [conn57] 
 
***aborting after fassert() failure



 Comments   
Comment by auto [ 12/Sep/12 ]

Author:

{u'date': u'2012-09-07T11:41:06-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: SERVER-6948 Make it safe to call commitIfNeeded() from a read lock
Branch: v2.2
https://github.com/mongodb/mongo/commit/c6307f01ee4c49a46b34f083c447f4b82958dd9c

Comment by auto [ 07/Sep/12 ]

Author:

{u'date': u'2012-09-07T11:41:06-07:00', u'email': u'mathias@10gen.com', u'name': u'Mathias Stearn'}

Message: SERVER-6948 Make it safe to call commitIfNeeded() from a read lock
Branch: master
https://github.com/mongodb/mongo/commit/d4f46ee169f5bf3d365ed60956bd21a9c4664e97

Comment by Mathias Stearn [ 05/Sep/12 ]

Updated description to not mention using 'db' in $where. It can actually be triggered by any use of $where due to Scope::loadStored().

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