- 27 Apr 2023
-
DarkLight
-
PDF
MongoDB Read Concern/Write Concern in IAP
- Updated on 27 Apr 2023
-
DarkLight
-
PDF
When MongoDB is upgraded to version 5.0, the default settings for readConcern
and writeConcern
operations will change. Moreover, the default settings may impact the execution of workflow jobs or deteriorate overall job execution performance. Hence, Itential recommends that additional care is taken when setting these default values. This release alert provides additional guidance on how to configure the default values for readConcern
and writeConcern
in MongoDB.
⁃ For detailed information on read/write concern operations, please refer to the official MongoDB guide: Default MongDB Read Concerns/Write Concerns.
⁃ For information on installing and configuring MongoDB with Itential Automation Platform (IAP), see: Installing MongoDB Dependency.
Read Concern
If the default value of readConcern
is set to "majority", the IAP database client is not configured to observe this setting. Additionally, you may have issues where the execution of jobs are impacted. To resolve this situation, set readConcern
to "local" on MongoDB.
-
Run this command to check the existing default settings.
db.adminCommand({ getDefaultRWConcern: 1 })
-
Set the default
readConcern
to "local" level.db.adminCommand( { setDefaultRWConcern : 1, defaultReadConcern: { “level“: “local“ } } )
Write Concern
If the default value of writeConcern
is set to "majority", there could be a delay in job execution because the client not only has to write to a primary MongoDB, but also to secondary databases. Itential recommends that you evaluate how critical the data is within replica sets and set the writeConcern
value accordingly.
If having a write
replication is not important, you can disable this property with the following command.
db.adminCommand(
{
setDefaultRWConcern: 1,
defaultWriteConcern: {},
}
)
If you want replication on the "majority" of the replica sets, use the following command.
db.adminCommand(
{
setDefaultRWConcern : 1,
defaultWriteConcern: {"level": "majority"},
}
)
Further Reading
For detailed information on the database commands to retrieve default read/write concern settings, see:
Customer Support
If you are unsure of how to specify the default read/write concern settings and need assistance, please open a service request ticket using the Customer Portal. The Itential Support Team is available to help with any clarifications.