Skip to content

Instantly share code, notes, and snippets.

@ajdavis
Created February 12, 2012 14:53
Show Gist options
  • Save ajdavis/1808903 to your computer and use it in GitHub Desktop.
Save ajdavis/1808903 to your computer and use it in GitHub Desktop.
mongooplog output
$ mongo --port 4000
MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:4000/test
PRIMARY> db.test.insert({'foo':'bar'})
PRIMARY> use local
PRIMARY> db.oplog.rs.find().sort({$natural:-1})
{ "ts" : { "t" : 1329058902000, "i" : 1 }, "h" : NumberLong("-9209932462579884476"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f37d45611558d5848a3d21a"), "foo" : "bar" } }
$ ./mongooplog --from localhost:4000 --port 5000 -s 300
connected to: 127.0.0.1:5000
Sun Feb 12 10:03:33 [oplogreplay] going to connect
Sun Feb 12 10:03:33 [oplogreplay] connected
Sun Feb 12 10:03:33 [oplogreplay] starting from Feb 12 09:58:33:0
1 { ts: Timestamp 1329058902000|1, h: -9209932462579884476, op: "i", ns: "test.test", o: { _id: ObjectId('4f37d45611558d5848a3d21a'), foo: "bar" } }
{ applied: 1, ok: 1.0 }
Sun Feb 12 10:03:35 [oplogreplay] thread oplogreplay stack usage was 11760 bytes
_DEBUG warning trying to lock a mongo::mutex during static shutdown
0x107f127a5 0x107f210df 0x1080b25a8 0x1081b1a5e 0x1081b84cc 0x109c25cce 0x1081bd58e 0x1081bd698 0x1081ac67b 0x7fff8e20c7c8 0x7fff8e20c652 0x107e4c23b 0x7
0 mongooplog 0x0000000107f127a5 _ZN5mongo15printStackTraceERSo + 37
1 mongooplog 0x0000000107f210df _ZN5mongo5mutex11scoped_lock15PostStaticCheckC1Ev + 87
2 mongooplog 0x00000001080b25a8 _ZN5mongo5mutex11scoped_lockC1ERS0_ + 40
3 mongooplog 0x00000001081b1a5e _ZN5mongo6ClientD0Ev + 528
4 mongooplog 0x00000001081b84cc _ZN5boost19thread_specific_ptrIN5mongo6ClientEE11delete_dataclEPv + 50
5 libboost_thread-mt.dylib 0x0000000109c25cce _ZN5boost6detail12set_tss_dataEPKvNS_10shared_ptrINS0_20tss_cleanup_functionEEEPvb + 190
6 mongooplog 0x00000001081bd58e _ZN5boost19thread_specific_ptrIN5mongo6ClientEED1Ev + 58
7 mongooplog 0x00000001081bd698 _ZN5mongo3TSPINS_6ClientEED1Ev + 24
8 mongooplog 0x00000001081ac67b __tcf_7 + 27
9 libsystem_c.dylib 0x00007fff8e20c7c8 __cxa_finalize + 274
10 libsystem_c.dylib 0x00007fff8e20c652 exit + 18
11 mongooplog 0x0000000107e4c23b start + 59
12 ??? 0x0000000000000007 0x0 + 7
mongod log on mongooplog's target machine:
Sun Feb 12 10:03:33 [initandlisten] connection accepted from 127.0.0.1:58431 #2315
Sun Feb 12 10:03:33 [conn2315] runQuery called admin.$cmd { applyOps: [ { ts: Timestamp 1329058902000|1, h: -9209932462579884476, op: "i", ns: "test.test", o: { _id: ObjectId('4f37d45611558d5848a3d21a'), foo: "bar" } } ] }
Sun Feb 12 10:03:33 [conn2315] run command admin.$cmd { applyOps: [ { ts: Timestamp 1329058902000|1, h: -9209932462579884476, op: "i", ns: "test.test", o: { _id: ObjectId('4f37d45611558d5848a3d21a'), foo: "bar" } } ] }
Sun Feb 12 10:03:33 [conn2315] command admin.$cmd command: { applyOps: [ { ts: Timestamp 1329058902000|1, h: -9209932462579884476, op: "i", ns: "test.test", o: { _id: ObjectId('4f37d45611558d5848a3d21a'), foo: "bar" } } ] } ntoreturn:1 reslen:50 0ms
Sun Feb 12 10:03:33 [conn2189] getmore local.oplog.rs query: { ts: { $gte: new Date(5707233657677152257) } } cursorid:7703458210213893076 nreturned:1 reslen:197 825ms
Sun Feb 12 10:03:33 [journal] lsn set 63211163
$ mongo --port 5000
MongoDB shell version: 2.0.2
connecting to: 127.0.0.1:5000/test
PRIMARY> db.test.find({'foo':'bar'})
PRIMARY> use local
switched to db local
PRIMARY> db.oplog.rs.find().sort({$natural:-1})
{ "ts" : { "t" : 1329059013000, "i" : 1 }, "h" : NumberLong("-3716827351705869399"), "op" : "c", "ns" : "admin.$cmd", "o" : { "applyOps" : [ { "ts" : { "t" : 1329058902000, "i" : 1 }, "h" : NumberLong("-9209932462579884476"), "op" : "i", "ns" : "test.test", "o" : { "_id" : ObjectId("4f37d45611558d5848a3d21a"), "foo" : "bar" } } ] } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment