For upgrade and --enableMajorityReads toggling, startup of a 4.1 mongod must accommodate cases where table logging settings are not in the desired state for the current process lifetime.
The constructor code path is hit in 3 cases:
- Collection and index creation
- Rollback via RTT
Because the desired setting cannot change during the lifetime of a process, ideally we'd only perform the operation on startup (creating new tables selects the right one). I don't believe there's a clear way to distinguish between these cases;
I believe the real work of this ticket is to find/add one.
Going by alexander.gorrod's last comment, we can first query the metadata and do a (fragile) string search for log=(enabled=<true|false>) and only call alter if the settings need to be changed.