[SERVER-43959] Warning for enableMajorityReadConcern not showing up in logs as expected Created: 11/Oct/19  Updated: 29/Oct/23  Resolved: 05/Nov/20

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

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Jordi Serra Torrens
Resolution: Fixed Votes: 0
Labels: neweng, neweng-kal
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Sharding 2019-11-04, Sharding 2019-11-18, Sharding 2019-12-02, Sharding 2019-12-16, Sharding 2019-12-30, Sharding 2020-01-13, Sharding 2020-11-02
Participants:

 Description   

User reported that this warning doesn't show up in the logs when --enableMajorityReadConcern is set to false in config servers



 Comments   
Comment by Githook User [ 05/Nov/20 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-43959: Use "default" initializer prerequisite for warning in mongod_options to avoid need for dummy initializer in unit tests.
Branch: master
https://github.com/mongodb/mongo/commit/dd7cc35422c9be911f646a163c78af7b4d340b11

Comment by Jordi Serra Torrens [ 05/Nov/20 ]

Using the "default" prerequisite instead of "ServerLogRedirection" in MONGO_INITIALIZER_WITH_PREREQUISITES will remove the need to add the dummy initializer. The 'default' initializer is a dependent of "ServerLogRedirection", so the dependencies will still be met.

I will go ahead and propose that change.

Comment by Lingzhi Deng [ 04/Nov/20 ]

With this change, mongod_options depends on logging. So any new dependency on the mongod_options that need to reference any mongod options would need to add a dummy initializer for ServerLogRedirection if used in unittests just to stub out the dependency. Is adding the dummy initializer the expected way to solve this issue (which seems a bit inconvenient)? Or is there a better way to implement this ticket?

Comment by Githook User [ 28/Oct/20 ]

Author:

{'name': 'Jordi Serra Torrens', 'email': 'jordi.serra-torrens@mongodb.com', 'username': 'jordist'}

Message: SERVER-43959: Make warning for enableMajorityReadConcern show on log
Branch: master
https://github.com/mongodb/mongo/commit/13e5ae6c1b06532e96ff510271572dd641dd1fa4

Comment by Spencer Brown [ 11/Oct/19 ]

The warning appears on the console when you start the mongod.

At a minimum it would be helpful to have this warning logged in the mongod log file, If you want to make it a startup warning, that's up to you,

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