[SERVER-8666] adding large docs to capped collection can fail based on history Created: 22/Feb/13  Updated: 10/Dec/14  Resolved: 16/May/14

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: 2.2.2
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Denis Shashkov Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6981 maxPasses assertion (on allocation fa... Closed
Related
is related to SERVER-11894 Inserting into a capped collection an... Closed
Participants:

 Description   

In the version 2.2.2 MAX_LOG_LINE is a constant defined in src/mongo/util/log.cpp:

    299         const size_t MAX_LOG_LINE = 1024 * 10;

With profiling enabled, queries with long lines yields assertion:

Fri Feb 22 12:29:30 [conn36866007] warning: warning: log line attempted (83k) over max size(10k), printing beginning and end ... can't add full line to system.profile: ...
passes ns:Db.system.profile len:85704 maxPasses: 5000
passes max:2147483647 nrecords:4153 datasize: 1734568
Fri Feb 22 12:29:30 [conn36866007] Assertion: 10345:passes >= maxPasses in capped collection alloc
0x9ec2f6 0x9b6146 0x644217 0x7a0428 0x7a532b 0x7d9841 0x75b8dd 0x75cb8d 0x758c26 0x58d009 0x9db0c9 0x7fc9b30459ca 0x7fc9b23ec21d 
 /usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x26) [0x9ec2f6]
 /usr/bin/mongod(_ZN5mongo11msgassertedEiPKc+0x96) [0x9b6146]
 /usr/bin/mongod(_ZN5mongo16NamespaceDetails11cappedAllocEPKci+0x377) [0x644217]
 /usr/bin/mongod(_ZN5mongo16NamespaceDetails6_allocEPKci+0x18) [0x7a0428]
 /usr/bin/mongod(_ZN5mongo16NamespaceDetails5allocEPKciRNS_7DiskLocE+0x3b) [0x7a532b]
 /usr/bin/mongod(_ZN5mongo11DataFileMgr17fast_oplog_insertEPNS_16NamespaceDetailsEPKci+0x71) [0x7d9841]
 /usr/bin/mongod() [0x75b8dd]
 /usr/bin/mongod(_ZN5mongo7profileERKNS_6ClientEiRNS_5CurOpE+0x3dd) [0x75cb8d]
 /usr/bin/mongod(_ZN5mongo16assembleResponseERNS_7MessageERNS_10DbResponseERKNS_11HostAndPortE+0x996) [0x758c26]
 /usr/bin/mongod(_ZN5mongo16MyMessageHandler7processERNS_7MessageEPNS_21AbstractMessagingPortEPNS_9LastErrorE+0xd9) [0x58d009]
 /usr/bin/mongod(_ZN5mongo3pms9threadRunEPNS_13MessagingPortE+0x439) [0x9db0c9]
 /lib/libpthread.so.0(+0x69ca) [0x7fc9b30459ca]
 /lib/libc.so.6(clone+0x6d) [0x7fc9b23ec21d]
Fri Feb 22 12:29:30 [conn36866007] warning: Caught Assertion while trying to profile update against Db.collection: 10345 passes >= maxPasses in capped collection alloc

Of course, it can happen many times at any times.
Maybe, it will be better to make this parameter as configurable?



 Comments   
Comment by Adamo Tonete [ 19/Feb/14 ]

Eliot,

I have the same problem and my mongod instance is down after this message.

I set the profiling level to 2 and after a insert of a object with 93k I received this message.
So,after this message my replicaset stop to sync between them.

Print:

Wed Feb 19 10:51:15.415 [repl writer worker 1] ERROR: warning: log line attempted (93k) over max size(10k), printing beginning and end

Wed Feb 19 10:51:15.415 [repl writer worker 1] Fatal Assertion 16360
0xde05e1 0xda03d3 0xc28f3c 0xdadf21 0xe28e69 0x7f200a598c6b 0x7f200993e5ed
/usr/bin/mongod(_ZN5mongo15printStackTraceERSo+0x21) [0xde05e1]
/usr/bin/mongod(_ZN5mongo13fassertFailedEi+0xa3) [0xda03d3]
/usr/bin/mongod(_ZN5mongo7replset14multiSyncApplyERKSt6vectorINS_7BSONObjESaIS2_EEPNS0_8SyncTailE+0x12c) [0xc28f3c]
/usr/bin/mongod(_ZN5mongo10threadpool6Worker4loopEv+0x281) [0xdadf21]
/usr/bin/mongod() [0xe28e69]
/lib64/libpthread.so.0(+0x7c6b) [0x7f200a598c6b]
/lib64/libc.so.6(clone+0x6d) [0x7f200993e5ed]
Wed Feb 19 10:51:15.473 [repl writer worker 1]

***aborting after fassert() failure

Wed Feb 19 10:51:15.473 Got signal: 6 (Aborted).

In the same document have this error too (SERVER-12788), maybe it causes the crash of mongod and this message is just a alert how you said.

Comment by Eliot Horowitz (Inactive) [ 24/Feb/13 ]

I think what happened here is a bit different.
The long line issue was just a warning printed.

Writing to the profile collection for a totally different reason.
My quick understanding is that the doc being writting is bigger than any extent (or the entire collection) and is failing for that reason.

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