-
-
Notifications
You must be signed in to change notification settings - Fork 188
Description
Versions
- NodeJS: 16.19.0
- mongodb-memory-server-*: 8.4.2
- mongodb(the binary version): 5.0.14
- mongodb(the js package): 4.5.0
- system: Linux Kubuntu 22.04
package: mongo-memory-server-global
What is your question?
The ephemeralForTest storage engine is reaching its end of life.
Context
In the project I'm working on, each test cleans its test collections by issuing collection.deleteMany({}) on every modified collection during the test. All these deleteMany are executed in parallel.
When executing many tests, it happens that the mongod server crashes with a segfault.
After opening an issue in MongoDB's Jira, it appears the "ephemeralForTest" engine has become unstable, starting with MongoDB 5.
They even intend to suppress entirely this engine with MongoDB 7. Cf. this comment:
In 5.0, we replaced the ephemeralForTest storage engine [...] The new implementation [...] had many bugs, like the one you discovered, and in the 7.0 release, we will remove the ephemeralForTest engine entirely
Workaround
As suggested, I used the wiredTiger engine (thanks to mongo-memory-server's option instance.storageEngine) and everything works like a charm.
I made a few benchmarks, and the performances are comparable.
Question
Knowing this, I have a few interrogations/suggestions:
- should this information be documented?
- would it be possible to have a different default engine depending on the mongodb version used?