[SERVER-31823] Turning on the profiler inhibits initiating a replica set Created: 03/Nov/17  Updated: 30/Oct/23  Resolved: 07/Nov/17

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 3.6.0-rc2
Fix Version/s: 3.6.0-rc4

Type: Bug Priority: Critical - P2
Reporter: Eric Milkie Assignee: Eric Milkie
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

1. Start mongod
./mongod --replSet foo --bind_ip 0.0.0.0

2. Start mongo
db.setProfilingLevel(2)
rs.initiate()

This will result in a failure of the command with:
"Not primary while setting collection options on test.system.profile"
(which is confusing because this is the output of the collMod command to set a UUID – this is not indicated in the error message)

Sprint: Storage 2017-11-13
Participants:
Linked BF Score: 0

 Description   

Turning on the profiler on a replicated database writes a new system.profile collection to the database, even if initiate has not yet run.

Subsequently, if you then run initiate, it will fail because it will attempt to assign a UUID to the system.profile collection, but this is prohibited because the node is not yet a PRIMARY.



 Comments   
Comment by Githook User [ 07/Nov/17 ]

Author:

{'name': 'Eric Milkie', 'username': 'milkie', 'email': 'milkie@10gen.com'}

Message: SERVER-31823 amend comment
Branch: master
https://github.com/mongodb/mongo/commit/e0040e5ee3c9bd0aa8c7658fb63192130ba91980

Comment by Githook User [ 07/Nov/17 ]

Author:

{'name': 'Eric Milkie', 'username': 'milkie', 'email': 'milkie@10gen.com'}

Message: SERVER-31823 allow user writes to system.profile collections in any database on SECONDARIES
Branch: master
https://github.com/mongodb/mongo/commit/c1f9f7c289017eccd3d73f0b5423fa3b07699094

Comment by Eric Milkie [ 03/Nov/17 ]

A corollary to this is that if you attempt this repro and then restart mongod, it thinks you have data already, and thus fails to start up; it suggests you need to run mongodb 3.4!

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