[SERVER-30170] Figure out a way to shutdown MongoDB without killing process if embedded Created: 17/Jul/17  Updated: 30/Oct/23  Resolved: 26/Mar/18

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

Type: Task Priority: Major - P3
Reporter: Ted Tuckman Assignee: Henrik Edin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-33629 Mechanism to shutdown MONGO_INITIALIZER Closed
Backwards Compatibility: Fully Compatible
Sprint: Platforms 2018-03-26, Platforms 2018-04-09
Participants:

 Comments   
Comment by Githook User [ 26/Mar/18 ]

Author:

{'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin', 'username': 'henrikedin'}

Message: SERVER-30170 Embedded can now shutdown and re-initialize.

  • ServiceContext* is now closer to be an instance context for the database. We still don't support multiple instances but I wrote the new code with this in mind. Teardown and reinitialize then becomes a matter of being able to delete and re-create the ServiceContext*.
  • Use the new MONGO_INITIALIZER that supports deinit/reinit to be able to re-initialize global systems that are decorations on ServiceContext.
  • Move creation/destruction of ServiceContext* out of MONGO_INITIALIZER. This so we can hold an exclusive lock during as much as possible of the shutdown (like how mongod does)
  • New ServiceContext registrer where we can link in different implementations of ServiceContext (replaces the SetGlobalEnvironment MONGO_INITIALIZER)
  • As a result the SetGlobalEnvironment prerequisite for MONGO_INITIALIZERs is gone.
  • The ServiceContext is passed to runGlobalInitializers, put in InitializationContext/DeinitializationContext so the initializers know which context they operate on.
    Branch: master
    https://github.com/mongodb/mongo/commit/af600c3876a26f62d8dde93bf769fc4ca3054072
Comment by Githook User [ 26/Mar/18 ]

Author:

{'email': 'henrik.edin@mongodb.com', 'name': 'Henrik Edin', 'username': 'henrikedin'}

Message: SERVER-30170 Embedded can now shutdown and re-initialize. Enterprise module changes to make it work with regards to how the ServiceContext is created.
Branch: master
https://github.com/10gen/mongo-enterprise-modules/commit/28cf9e5f7e8854e222476962546b37f925ba14e4

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