[SERVER-7974] Suppress stack trace on replication errors Created: 18/Dec/12  Updated: 11/Jul/16  Resolved: 03/May/13

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: 2.2.0, 2.2.2
Fix Version/s: 2.5.0

Type: Bug Priority: Minor - P4
Reporter: Gianfranco Palumbo Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: replication
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Operating System: ALL
Steps To Reproduce:

1) Shutdown down a secondary
2) Start it without --replSet and another port
3) Create unique index on secondary
4) Restart as replSet member
5) Insert a document in the primary which would duplicate a key in the index in the primary

eg.
//step 3
db.test.ensureIndex(

{"a": 1}

,

{"unique": true}

)
db.test.insert(

{a:1}

)
//step 4
db.test.insert(

{a:1}

)

Participants:

 Description   

As mentioned in the comments in SERVER-6228, this should be handled via a clean shutdown or logging the assertion.

Tue Dec 18 12:05:54 [initandlisten] MongoDB starting : pid=6992 port=40002 dbpath=/Users/gianfranco/data/replset/node2 64-bit host=Gianfranco-10gen.local
Tue Dec 18 12:05:54 [initandlisten] db version v2.2.2, pdfile version 4.5
Tue Dec 18 12:05:54 [initandlisten] git version: d1b43b61a5308c4ad0679d34b262c5af9d664267
Tue Dec 18 12:05:54 [initandlisten] build info: Darwin bs-osx-106-x86-64-1.local 10.8.0 Darwin Kernel Version 10.8.0: Tue Jun  7 16:33:36 PDT 2011; root:xnu-1504.15.3~1/RELEASE_I386 i386 BOOST_LIB_VERSION=1_49
Tue Dec 18 12:05:54 [initandlisten] options: { dbpath: "/Users/gianfranco/data/replset/node2", port: 40002, replSet: "myapp" }
Tue Dec 18 12:05:54 [initandlisten] journal dir=/Users/gianfranco/data/replset/node2/journal
Tue Dec 18 12:05:54 [initandlisten] recover : no journal files present, no recovery needed
Tue Dec 18 12:05:54 [websvr] admin web console waiting for connections on port 41002
...
Tue Dec 18 12:06:18 [repl writer worker 1] ERROR: writer worker caught exception: E11000 duplicate key error index: test.test.$a_1  dup key: { : 1.0 } on: { ts: Timestamp 1355832378000|1, h: 6182722510085346418, v: 2, op: "i", ns: "test.test", o: { _id: ObjectId('50d05c3a8a41536396de58f9'), a: 1.0 } }
Tue Dec 18 12:06:18 [repl writer worker 1]   Fatal Assertion 16360
0x10059544b 0x100557dc5 0x10043e700 0x1005688ed 0x1005e08e3 0x7fff8e926742 0x7fff8e913181 
 0   mongod                              0x000000010059544b _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x0000000100557dc5 _ZN5mongo13fassertFailedEi + 165
 2   mongod                              0x000000010043e700 _ZN5mongo7replset14multiSyncApplyERKSt6vectorINS_7BSONObjESaIS2_EEPNS0_8SyncTailE + 336
 3   mongod                              0x00000001005688ed _ZN5mongo10threadpool6Worker4loopEv + 621
 4   mongod                              0x00000001005e08e3 thread_proxy + 163
 5   libsystem_c.dylib                   0x00007fff8e926742 _pthread_start + 327
 6   libsystem_c.dylib                   0x00007fff8e913181 thread_start + 13
Tue Dec 18 12:06:18 [repl writer worker 1] 
 
***aborting after fassert() failure
 
 
Tue Dec 18 12:06:18 Got signal: 6 (Abort trap: 6).
 
Tue Dec 18 12:06:18 Backtrace:
0x10059544b 0x10000197b 0x7fff8e9148ea 0x105c98970 0x7fff8e96bdce 0x100557e00 0x10043e700 0x1005688ed 0x1005e08e3 0x7fff8e926742 0x7fff8e913181 
 0   mongod                              0x000000010059544b _ZN5mongo15printStackTraceERSo + 43
 1   mongod                              0x000000010000197b _ZN5mongo10abruptQuitEi + 987
 2   libsystem_c.dylib                   0x00007fff8e9148ea _sigtramp + 26
 3   ???                                 0x0000000105c98970 0x0 + 4392061296
 4   libsystem_c.dylib                   0x00007fff8e96bdce abort + 143
 5   mongod                              0x0000000100557e00 _ZN5mongo13fassertFailedEi + 224
 6   mongod                              0x000000010043e700 _ZN5mongo7replset14multiSyncApplyERKSt6vectorINS_7BSONObjESaIS2_EEPNS0_8SyncTailE + 336
 7   mongod                              0x00000001005688ed _ZN5mongo10threadpool6Worker4loopEv + 621
 8   mongod                              0x00000001005e08e3 thread_proxy + 163
 9   libsystem_c.dylib                   0x00007fff8e926742 _pthread_start + 327
 10  libsystem_c.dylib                   0x00007fff8e913181 thread_start + 13



 Comments   
Comment by auto [ 03/May/13 ]

Author:

{u'date': u'2013-05-02T21:47:26Z', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-7974 Suppress stack trace on replication errors
Branch: master
https://github.com/mongodb/mongo/commit/a9adef030bde00e872ee46e0ae5caec60a97a50e

Comment by Gianfranco Palumbo [ 05/Mar/13 ]

Yes I think suppressing the stack trace would be a good idea.

Comment by Eric Milkie [ 08/Feb/13 ]

A secondary server shuts down when it detects a replication error, by design.
We can suppress the stack trace if that would help make it look more clean.

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