[SERVER-13163] WriteBatchExecutor doesn't handle PageFaultException during inserts. Created: 12/Mar/14  Updated: 11/Jul/16  Resolved: 19/Mar/14

Status: Closed
Project: Core Server
Component/s: Write Ops
Affects Version/s: 2.6.0-rc1
Fix Version/s: 2.6.0-rc2

Type: Bug Priority: Blocker - P1
Reporter: Andy Schwerin Assignee: Andy Schwerin
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-13121 ninserted is one too few, for write c... Closed
Related
Operating System: ALL
Steps To Reproduce:

Reliably fails the small oplog jsCore with write commands suite on Windows DEBUG builders.

Participants:
Linked BF Score: 0

 Description   

All db record accesses that occur while a PageFaultRetryableSection is instantiated on a thread's stack must be wrapped in an exception handler for PageFaultException. WriteBatchExecutor::execInserts violates this rule, allowing PFE to escape up the stack, leading to server aborts when records are determined to not be in memory.

Correct use of PFRS is as follows:

bool done = false;
PageFaultRetryableSection pFaultSection;
while (!done) {
    try {
        DB*Lock myLock(dbname);
        // Do all operations involving record access here.
        ...
        done = true;
    }
    catch (const PageFaultException& pfe) {
        pfe.touch();
    }
}



 Comments   
Comment by Githook User [ 19/Mar/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13163/SERVER-13165 Target index creations correctly in the oplog on insert write commands.

(cherry picked from commit d9e4242d7f8c2631834a8b84cddf2f98cd1971b3)
Branch: v2.6
https://github.com/mongodb/mongo/commit/670a13d965a5bf949e33309ef47b49a23326a59c

Comment by Githook User [ 19/Mar/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13163/SERVER-13165 Target index creations correctly in the oplog on insert write commands.
Branch: master
https://github.com/mongodb/mongo/commit/d9e4242d7f8c2631834a8b84cddf2f98cd1971b3

Comment by Githook User [ 19/Mar/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13163/SERVER-13165 Assign fassert codes.
Branch: master
https://github.com/mongodb/mongo/commit/f005fc6b5275bda6b6988413d83b61aab099ff63

Comment by Githook User [ 19/Mar/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13163/SERVER-13165 Assign fassert codes.
Branch: v2.6
https://github.com/mongodb/mongo/commit/11e8a1d1b7d58b710a8a6f59e507dafcec01f247

Comment by Githook User [ 19/Mar/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13163/SERVER-13165 Refactor implementation of insert write command in mongod.

The goal of the refactoring is to clarify the control flow of the batch
execution of inserts, and in so doing to cleanly handle PageFaultExceptions,
properly handle demotion to secondary, correctly profile individual document
insertions within the batch, and correctly attribute lock hold and acquisition
time to those individual insertions.

It is also intended that this refactoring will resolve memory leaks in the
insert code path, by more carefully tracking ownership of WriteErrorDetail
objects throughout the WriteBatchExecutor class.
Branch: v2.6
https://github.com/mongodb/mongo/commit/2758187dd41024a8f93fddc7edfc223eccf4a1ce

Comment by Githook User [ 19/Mar/14 ]

Author:

{u'username': u'andy10gen', u'name': u'Andy Schwerin', u'email': u'schwerin@mongodb.com'}

Message: SERVER-13163/SERVER-13165 Refactor implementation of insert write command in mongod.

The goal of the refactoring is to clarify the control flow of the batch
execution of inserts, and in so doing to cleanly handle PageFaultExceptions,
properly handle demotion to secondary, correctly profile individual document
insertions within the batch, and correctly attribute lock hold and acquisition
time to those individual insertions.

It is also intended that this refactoring will resolve memory leaks in the
insert code path, by more carefully tracking ownership of WriteErrorDetail
objects throughout the WriteBatchExecutor class.
Branch: master
https://github.com/mongodb/mongo/commit/7300f943ab5423dfcf8ad66d916648a86f861b47

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