[SERVER-3908] setProfilingLevel on secondary results in "logOp() but not primary" error Created: 20/Sep/11  Updated: 10/Dec/14  Resolved: 16/Jul/13

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 2.0.0
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kristina Chodorow (Inactive) Assignee: Daniel Pasette (Inactive)
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Operating System: ALL
Participants:

 Description   

Tue Sep 20 12:23:25 [initandlisten] connection accepted from 127.0.0.1:36938 #5
Tue Sep 20 12:23:40 [conn5] Assertion: 13312:replSet error : logOp() but not primary?
0x55f5aa 0x713191 0x711052 0x77d9d6 0x76b5a9 0x7e18d8 0x7dd844 0x7de8f1 0x647e45 0x64b3de 0x7547a5 0x759ec8 0x8a8fce 0x8bb630 0x7fae1fe1ad8c 0x7fae1f3c504d 
 ./mongod(_ZN5mongo11msgassertedEiPKc+0x12a) [0x55f5aa]
 ./mongod() [0x713191]
 ./mongod(_ZN5mongo5logOpEPKcS1_RKNS_7BSONObjEPS2_Pb+0x42) [0x711052]
 ./mongod(_ZN5mongo12userCreateNSEPKcNS_7BSONObjERSsbPb+0x586) [0x77d9d6]
 ./mongod(_ZN5mongo8Database17setProfilingLevelEiRSs+0x349) [0x76b5a9]
 ./mongod(_ZN5mongo10CmdProfile3runERKSsRNS_7BSONObjERSsRNS_14BSONObjBuilderEb+0x118) [0x7e18d8]
 ./mongod(_ZN5mongo11execCommandEPNS_7CommandERNS_6ClientEiPKcRNS_7BSONObjERNS_14BSONObjBuilderEb+0x724) [0x7dd844]
 ./mongod(_ZN5mongo12_runCommandsEPKcRNS_7BSONObjERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x831) [0x7de8f1]
 ./mongod(_ZN5mongo11runCommandsEPKcRNS_7BSONObjERNS_5CurOpERNS_10BufBuilderERNS_14BSONObjBuilderEbi+0x35) [0x647e45]
 ./mongod(_ZN5mongo8runQueryERNS_7MessageERNS_12QueryMessageERNS_5CurOpES1_+0x324e) [0x64b3de]
 ./mongod() [0x7547a5]
 ./mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_8SockAddrE+0x5b8) [0x759ec8]
 ./mongod(_ZN5mongo10connThreadEPNS_13MessagingPortE+0x21e) [0x8a8fce]
 ./mongod(thread_proxy+0x80) [0x8bb630]
 /lib/x86_64-linux-gnu/libpthread.so.0(+0x6d8c) [0x7fae1fe1ad8c]
 /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7fae1f3c504d]



 Comments   
Comment by Daniel Pasette (Inactive) [ 16/Jul/13 ]

This is indeed not reproducible. Re-closing.

Comment by Eric Milkie [ 12/Jul/13 ]

The call stack in the description shows that the error is happening during the processing of the setProfilingLevel command – I don't yet see how causing something to be profiled after the fact will cause this issue.
dan@10gen.com can you give more details on the repro?

Comment by Daniel Pasette (Inactive) [ 11/Jul/13 ]

You only can repro by causing something to be inserted into the profile collection.

name:SECONDARY> db.serverBuildInfo()
{
	"version" : "2.5.1-pre-",
	"gitVersion" : "fb84a8e047ead09d4a457c6e81710d5e0a4e79b5",
	"sysInfo" : "Darwin crucible-2.local 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan  6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
	"loaderFlags" : "-fPIC -pthread -Wl,-bind_at_load",
	"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -Werror -pipe -O3 -Wno-unused-function -Wno-deprecated-declarations -mmacosx-version-min=10.6",
	"allocator" : "tcmalloc",
	"versionArray" : [
		2,
		5,
		1,
		-100
	],
	"javascriptEngine" : "V8",
	"bits" : 64,
	"debug" : false,
	"maxBsonObjectSize" : 16777216,
	"ok" : 1
}
name:SECONDARY> db.setProfilingLevel(2)
{ "was" : 0, "slowms" : 100, "ok" : 1 }
name:SECONDARY> db.foo.find()
error: { "$err" : "not master and slaveOk=false", "code" : 13435 }

Comment by Matt Dannenberg [ 19/Jun/13 ]

I couldn't reproduce this (even on 2.0.0), it seemed to just work. I got back

{ "was" : 0, "slowms" : 100, "ok" : 1 }

.

Comment by Eric Milkie [ 14/Jun/13 ]

After further discussion, it looks like it might actually be not that hard to fix this and allow profiling to be turned on without being in PRIMARY state.

Comment by Daniel Pasette (Inactive) [ 14/Jun/13 ]

For now, i think it should error out more gracefully. Rather large change to change where profiling data goes.

Comment by Eric Milkie [ 28/May/13 ]

What should be the behavior here – profiling should go into a non-replicated collection, for replica sets? Or should it simply refuse to turn on with a better error message?

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