[SERVER-15055] rocks: unit testjstests/core/apitest_db.js and jstests/core/batch_write_command_insert.js fail Created: 27/Aug/14  Updated: 28/Apr/15  Resolved: 29/Aug/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 2.7.6

Type: Bug Priority: Major - P3
Reporter: Siying Dong Assignee: Unassigned
Resolution: Done Votes: 0
Labels: pull-request
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-15085 rocks storage fails when restarting Closed
related to SERVER-15161 RocksCursor::_reverseLocate() Should ... Closed
related to SERVER-15057 RocksStorage: deadlock when dropping ... Closed
related to SERVER-15232 Rocks Storage Engine to support Index... Closed
is related to SERVER-14352 prototype and implement rocksdb stora... Closed
is related to SERVER-13635 Clean up the storage abstraction layer Closed
Tested
Operating System: ALL
Steps To Reproduce:

1. Build with "--rocksdb=RocksDB" option
2. run mongod with "--storageEngine rocksExperiment" option
3. run "./mongo jstests/core/apitest_db.js" and batch_write_command_insert.js

Participants:

 Description   

This is to track unit test break of
jstests/core/apitest_db.js
jstests/core/batch_write_command_insert.js
when Rocks storage is used.



 Comments   
Comment by Alex Gorrod [ 18/Sep/14 ]

I'm seeing an issue related to the stack trace posted above.

The test that fails for me is: jstests/core/remove9.js using the WiredTiger storage engine. The stack trace I see is:

#3  0x00000000008ed238 in mongo::Collection::docFor (this=<optimized out>, txn=<optimized out>, 
    loc=...) at src/mongo/db/catalog/collection.cpp:161
#4  0x00000000009cdc49 in mongo::FetchStage::work (this=0x29cbde0, out=0x7fffeafa20f0)
    at src/mongo/db/exec/fetch.cpp:87
#5  0x0000000000bad365 in mongo::PlanExecutor::getNext (this=this@entry=0x2a1e080, 
    objOut=objOut@entry=0x7fffeafa2270, dlOut=dlOut@entry=0x0)
    at src/mongo/db/query/plan_executor.cpp:132
#6  0x0000000000b9980c in mongo::newGetMore (txn=txn@entry=0x2853740, 
    ns=ns@entry=0x2817414 "test.jstests_remove9", ntoreturn=ntoreturn@entry=0, 
    cursorid=cursorid@entry=8642097097, curop=..., pass=pass@entry=0, 
    exhaust=@0x7fffeafa2410: false, isCursorAuthorized=isCursorAuthorized@entry=0x7fffeafa2420)
    at src/mongo/db/query/new_find.cpp:243

If I update the implementation of in FetchStage::restoreState to update the saved OperationContext I no longer see the crash. A diff showing the change for clarity:

--- a/src/mongo/db/exec/fetch.cpp                                                                   
+++ b/src/mongo/db/exec/fetch.cpp                                                                   
@@ -120,6 +120,7 @@ namespace mongo {                                                               
                                                                                                    
     void FetchStage::restoreState(OperationContext* opCtx) {                                       
         ++_commonStats.unyields;                                                                   
+        _txn = opCtx;                                                                              
         _child->restoreState(opCtx);                                                               
     }

Would the above change be a reasonable fix? Should an equivalent change be made in all of the PlanStage subclasses?

Comment by Githook User [ 28/Aug/14 ]

Author:

{u'username': u'siying', u'name': u'sdong', u'email': u'siying.d@fb.com'}

Message: SERVER-15055 RocksDB storage engine: fix several unit tests

Several changes:
(1) return nrecords when validating a RocksRecordStore
(2) implement RocksRecordStore::Iterator::restoreState(), which reseek to the last seek location
(3) RocksSortedDataImpl::dupKeyCheck() return false when no exact key is found

This change would fix several tests, including:
jstests/core/apitest_db.js
jstests/core/auth*.js
jstests/core/batch_write_command_insert.js

Closes #758

Signed-off-by: Benety Goh <benety@mongodb.com>
Branch: master
https://github.com/mongodb/mongo/commit/4b3e0275c35e53505542c675bd2ef4a5e8a5a4da

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