[SERVER-14995] OperationContext should have a constant id for whole lifetime Created: 21/Aug/14  Updated: 25/Jan/17  Resolved: 04/Jun/15

Status: Closed
Project: Core Server
Component/s: Internal Code, Usability
Affects Version/s: None
Fix Version/s: 3.1.4

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

Issue Links:
Related
is related to SERVER-20661 Fix operation counting error in updat... Closed
Tested
Backwards Compatibility: Minor Change
Participants:

 Description   

Currently it uses CurOp's id, but CurOps can be nested and the nested CurOps each have their own id. Instead, the OperationContext should get an ID at construction time and use the same ID until it is over.



 Comments   
Comment by Githook User [ 05/Jun/15 ]

Author:

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

Message: SERVER-14995 Fix race condition in jstests/noPassthrough/update_yield1.js.
Branch: master
https://github.com/mongodb/mongo/commit/f30bd81cdcdabe19e45ed4c45d43a87160bdc58f

Comment by Githook User [ 02/Jun/15 ]

Author:

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

Message: SERVER-14995 Fix compile break introduced by commit-time race.
Branch: master
https://github.com/mongodb/mongo/commit/f6764a495fffaf095554a27479b717927157b26f

Comment by Githook User [ 02/Jun/15 ]

Author:

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

Message: SERVER-14995 Move _killPending from CurOp to OperationContext.

Also, limit the lifetime of OperationContext in MongoD so that it goes out of
scope before sending a reply to the client. This is necessary so that
operations do not appear in the currentOp command result after the server
sends a response to the client.
Branch: master
https://github.com/mongodb/mongo/commit/754f482c204160bf0c74373b64ba3406604f0731

Comment by Githook User [ 02/Jun/15 ]

Author:

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

Message: Reapply "SERVER-14995 Move operation id, lockState and client fields to OperationContext."

This reverts commit e181ea38af737ef7aaf5f8228f870d8c7149b2bb.
Branch: master
https://github.com/mongodb/mongo/commit/908d0cedf82b50c93932916685c4f8fa4748cc6f

Comment by Githook User [ 29/May/15 ]

Author:

{u'username': u'stbrody', u'name': u'Spencer T Brody', u'email': u'spencer@mongodb.com'}

Message: Revert "SERVER-14995 Move operation id, lockState and client fields to OperationContext."

This reverts commit 4ea38c308da292f43e29d32b1b53b7324db0bafe.
Branch: master
https://github.com/mongodb/mongo/commit/e181ea38af737ef7aaf5f8228f870d8c7149b2bb

Comment by Githook User [ 29/May/15 ]

Author:

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

Message: SERVER-14995 Move operation id, lockState and client fields to OperationContext.

They have been moved from OperationContextImpl. Furthermore, the CurOp stack is
now attached to OperationContext, instead of Client.

With this change, an operation's lifetime is governed by the lifetime of an
OperationContext object. The "_active" field of CurOp is therefore no longer
meaingful. This required fixing the lifetime of OperationContext in a few
places.

A future change will adjust operation lifetime timing to time the lifetime of
the OperationContext object, as well.
Branch: master
https://github.com/mongodb/mongo/commit/4ea38c308da292f43e29d32b1b53b7324db0bafe

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