[SERVER-7451] Add node startup information to the local DB Created: 23/Oct/12  Updated: 26/Oct/15  Resolved: 07/Jan/13

Status: Closed
Project: Core Server
Component/s: Admin
Affects Version/s: 2.2.0
Fix Version/s: 2.3.2

Type: Improvement Priority: Minor - P4
Reporter: Adam Comerford Assignee: Eliot Horowitz (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Any replica set


Issue Links:
Related
related to DOCS-955 Document new local.startup_log collec... Closed
Backwards Compatibility: Minor Change
Participants:

 Description   

Add info to local.myhoststartup or similar, idea is to record node start state and history information to aid diagnosis of issues etc.

Implementation is as follows:
Add a capped collection in local.startup_log of size 1MB to store the information for mongod with the following format:

{
	"_id" : "Daniels-MacBook-Air-2.local-1357416138107", //hostname + ms since the epoch
	"hostname" : "Daniels-MacBook-Air-2.local",
	"startTime" : ISODate("2013-01-05T20:02:18Z"),
	"startTimeLocal" : "Sat Jan  5 12:02:18.107",
	"cmdLine" : {
		"dbpath" : "/data/db/auth10",
		"keyFile" : "jstests/libs/key1",
		"port" : 30000
	},
	"pid" : 68783,
	"buildinfo" : {
		"version" : "2.3.2-pre-",
		"gitVersion" : "941c5bd713c16ef82f2be71fcb3b6af19f414512",
		"sysInfo" : "Darwin Daniels-MacBook-Air-2.local 11.4.2 Darwin Kernel Version 11.4.2: Thu Aug 23 16:25:48 PDT 2012; root:xnu-1699.32.7~1/RELEASE_X86_64 x86_64 BOOST_LIB_VERSION=1_49",
		"loaderFlags" : "-fPIC -pthread -rdynamic",
		"compilerFlags" : "-Wnon-virtual-dtor -Woverloaded-virtual -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -O3",
		"allocator" : "tcmalloc",
		"versionArray" : [
			2,
			3,
			2,
			-100
		],
		"javascriptEngine" : "v8",
		"bits" : 64,
		"debug" : false,
		"maxBsonObjectSize" : 16777216
	}
}



 Comments   
Comment by Scott Hernandez (Inactive) [ 29/Jan/13 ]

Test failure from CI/bamboo causing revert:

assert: ["ip"] != ["ip-10-31-150-135"] are not equal : Hostname doesn't match one from _id
29-Jan-2013 13:38:39	Error: Printing Stack Trace
29-Jan-2013 13:38:39	    at printStackTrace (src/mongo/shell/utils.js:37:7)
29-Jan-2013 13:38:39	    at doassert (src/mongo/shell/assert.js:6:1)
29-Jan-2013 13:38:39	    at Function.assert.eq (src/mongo/shell/assert.js:32:1)
29-Jan-2013 13:38:39	    at /home/bamboo/bamboo-agent-home/xml-data/build-dir/MONGODB-COMMITLINUX-JSCORE/jstests/dbadmin.js:65:8
29-Jan-2013 13:38:39	Tue Jan 29 13:38:39.715 ["ip"] != ["ip-10-31-150-135"] are not equal : Hostname doesn't match one from _id src/mongo/shell/assert.js:7
29-Jan-2013 13:38:39	failed to load: /home/bamboo/bamboo-agent-home/xml-data/build-dir/MONGODB-COMMITLINUX-JSCORE/jstests/dbadmin.js

Comment by auto [ 29/Jan/13 ]

Author:

{u'date': u'2013-01-29T16:50:16Z', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}

Message: revert: Add node startup information to the local DB jstests - SERVER-7451
Branch: master
https://github.com/mongodb/mongo/commit/3ff1634cf2c24c996f426872c5fafd83dc399e51

Comment by auto [ 29/Jan/13 ]

Author:

{u'date': u'2013-01-29T13:00:26Z', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}

Message: Merge pull request #362 from rozza/SERVER-7451

SERVER-7451: jstest for startup_log information
Branch: master
https://github.com/mongodb/mongo/commit/0f79c34fc9b652f3f3c7a9ec494dc316688e4e8d

Comment by auto [ 29/Jan/13 ]

Author:

{u'date': u'2013-01-29T13:00:26Z', u'email': u'scotthernandez@gmail.com', u'name': u'Scott Hernandez'}

Message: Merge pull request #362 from rozza/SERVER-7451

SERVER-7451: jstest for startup_log information
Branch: master
https://github.com/mongodb/mongo/commit/0f79c34fc9b652f3f3c7a9ec494dc316688e4e8d

Comment by auto [ 29/Jan/13 ]

Author:

{u'date': u'2013-01-29T12:10:39Z', u'email': u'ross.lawley@gmail.com', u'name': u'Ross Lawley'}

Message: Add node startup information to the local DB jstests - SERVER-7451
Branch: master
https://github.com/mongodb/mongo/commit/94e77ee131716d06d48f9df7aa2939491ada9ff6

Comment by Scott Hernandez (Inactive) [ 07/Jan/13 ]

Ross: This is done in C++ code and formatted there – no js.

        toLog.appendTimeT( "startTime", time(0) );
        char buf[64];
        curTimeString( buf );
        toLog.append( "startTimeLocal", buf );

https://github.com/mongodb/mongo/blob/master/src/mongo/db/db.cpp#L244

Comment by Ross Lawley [ 07/Jan/13 ]

StartTimeLocal is missing the year. Also, the formatting seems off I'd thought it should be the same as doing latestLog.startTime.toLocaleString() in the shell.

Comment by auto [ 18/Dec/12 ]

Author:

{u'date': u'2012-12-18T16:10:02Z', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}

Message: SERVER-7451 - fix disk full test error checking
Branch: master
https://github.com/mongodb/mongo/commit/85355c52122be895d4ae1bc966ec0d3339cf39d7

Comment by auto [ 11/Dec/12 ]

Author:

{u'date': u'2012-12-11T01:02:17Z', u'email': u'ben.becker@10gen.com', u'name': u'Ben Becker'}

Message: SERVER-7451: fix js tests that use getDBs().totalSize
Branch: master
https://github.com/mongodb/mongo/commit/43c63c1a941e655b532bef1e5a0b31692d4786da

Comment by auto [ 10/Dec/12 ]

Author:

{u'date': u'2012-12-10T20:25:33Z', u'email': u'eliot@10gen.com', u'name': u'Eliot Horowitz'}

Message: SERVER-7451 - add node startup info to local db at startup
Branch: master
https://github.com/mongodb/mongo/commit/a41f36c86f722af594e0ad1cfa9610ce03220a01

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