Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-26335

Initial sync with buildIndexes=false fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker - P1
    • Resolution: Fixed
    • Affects Version/s: 3.3.14
    • Fix Version/s: 3.3.15
    • Component/s: Replication
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      ALL
    • Steps To Reproduce:
      Hide

      Start two mongods:

      /tmp/mms-automation/test/versions/mongodb-osx-x86_64-3.3.14/bin/mongod --dbpath=db1 --replSet=rs0 --port=9005
      /tmp/mms-automation/test/versions/mongodb-osx-x86_64-3.3.14/bin/mongod --dbpath=db2 --replSet=rs0 --port=9006
      

      Initialize the replica set as follows:

      > rs.initiate({
      ... "_id" : "rs0",
      ... "version" : 1,
      ... "protocolVersion" : NumberLong(1),
      ... "members" : [
      ... {
      ... "_id" : 1,
      ... "host" : "neurofunk.local:9005"
      ... },
      ... {
      ... "_id" : 2,
      ... "host" : "neurofunk.local:9006",
      ... "priority" : 0,
      ... "buildIndexes" : false
      ... }
      ... ]
      ... })
      { "ok" : 1 }
      rs0:SECONDARY> 
      

      Watch the second node get stuck in STARTUP2:

      rs0:SECONDARY> rs.status()
      {
      	"set" : "rs0",
      	"date" : ISODate("2016-09-26T20:07:30.512Z"),
      	"myState" : 1,
      	"term" : NumberLong(1),
      	"heartbeatIntervalMillis" : NumberLong(2000),
      	"optimes" : {
      		"lastCommittedOpTime" : {
      			"ts" : Timestamp(0, 0),
      			"t" : NumberLong(-1)
      		},
      		"appliedOpTime" : {
      			"ts" : Timestamp(1474920450, 1),
      			"t" : NumberLong(1)
      		},
      		"durableOpTime" : {
      			"ts" : Timestamp(1474920450, 1),
      			"t" : NumberLong(1)
      		}
      	},
      	"members" : [
      		{
      			"_id" : 1,
      			"name" : "neurofunk.local:9005",
      			"health" : 1,
      			"state" : 1,
      			"stateStr" : "PRIMARY",
      			"uptime" : 84,
      			"optime" : {
      				"ts" : Timestamp(1474920450, 1),
      				"t" : NumberLong(1)
      			},
      			"optimeDate" : ISODate("2016-09-26T20:07:30Z"),
      			"infoMessage" : "could not find member to sync from",
      			"electionTime" : Timestamp(1474920389, 1),
      			"electionDate" : ISODate("2016-09-26T20:06:29Z"),
      			"configVersion" : 1,
      			"self" : true
      		},
      		{
      			"_id" : 2,
      			"name" : "neurofunk.local:9006",
      			"health" : 1,
      			"state" : 5,
      			"stateStr" : "STARTUP2",
      			"uptime" : 72,
      			"optime" : {
      				"ts" : Timestamp(0, 0),
      				"t" : NumberLong(-1)
      			},
      			"optimeDurable" : {
      				"ts" : Timestamp(0, 0),
      				"t" : NumberLong(-1)
      			},
      			"optimeDate" : ISODate("1970-01-01T00:00:00Z"),
      			"optimeDurableDate" : ISODate("1970-01-01T00:00:00Z"),
      			"lastHeartbeat" : ISODate("2016-09-26T20:07:29.742Z"),
      			"lastHeartbeatRecv" : ISODate("2016-09-26T20:07:29.219Z"),
      			"pingMs" : NumberLong(0),
      			"syncingTo" : "neurofunk.local:9005",
      			"configVersion" : 1
      		}
      	],
      	"ok" : 1
      }
      

      Show
      Start two mongods: /tmp/mms-automation/test/versions/mongodb-osx-x86_64-3.3.14/bin/mongod --dbpath=db1 --replSet=rs0 --port=9005 /tmp/mms-automation/test/versions/mongodb-osx-x86_64-3.3.14/bin/mongod --dbpath=db2 --replSet=rs0 --port=9006 Initialize the replica set as follows: > rs.initiate({ ... "_id" : "rs0", ... "version" : 1, ... "protocolVersion" : NumberLong(1), ... "members" : [ ... { ... "_id" : 1, ... "host" : "neurofunk.local:9005" ... }, ... { ... "_id" : 2, ... "host" : "neurofunk.local:9006", ... "priority" : 0, ... "buildIndexes" : false ... } ... ] ... }) { "ok" : 1 } rs0:SECONDARY> Watch the second node get stuck in STARTUP2: rs0:SECONDARY> rs.status() { "set" : "rs0", "date" : ISODate("2016-09-26T20:07:30.512Z"), "myState" : 1, "term" : NumberLong(1), "heartbeatIntervalMillis" : NumberLong(2000), "optimes" : { "lastCommittedOpTime" : { "ts" : Timestamp(0, 0), "t" : NumberLong(-1) }, "appliedOpTime" : { "ts" : Timestamp(1474920450, 1), "t" : NumberLong(1) }, "durableOpTime" : { "ts" : Timestamp(1474920450, 1), "t" : NumberLong(1) } }, "members" : [ { "_id" : 1, "name" : "neurofunk.local:9005", "health" : 1, "state" : 1, "stateStr" : "PRIMARY", "uptime" : 84, "optime" : { "ts" : Timestamp(1474920450, 1), "t" : NumberLong(1) }, "optimeDate" : ISODate("2016-09-26T20:07:30Z"), "infoMessage" : "could not find member to sync from", "electionTime" : Timestamp(1474920389, 1), "electionDate" : ISODate("2016-09-26T20:06:29Z"), "configVersion" : 1, "self" : true }, { "_id" : 2, "name" : "neurofunk.local:9006", "health" : 1, "state" : 5, "stateStr" : "STARTUP2", "uptime" : 72, "optime" : { "ts" : Timestamp(0, 0), "t" : NumberLong(-1) }, "optimeDurable" : { "ts" : Timestamp(0, 0), "t" : NumberLong(-1) }, "optimeDate" : ISODate("1970-01-01T00:00:00Z"), "optimeDurableDate" : ISODate("1970-01-01T00:00:00Z"), "lastHeartbeat" : ISODate("2016-09-26T20:07:29.742Z"), "lastHeartbeatRecv" : ISODate("2016-09-26T20:07:29.219Z"), "pingMs" : NumberLong(0), "syncingTo" : "neurofunk.local:9005", "configVersion" : 1 } ], "ok" : 1 }
    • Sprint:
      Repl 2016-10-10

      Description

      Using buildIndexes false will fail the new initial sync (using the DataReplicator).

      The hang in startup2 has been resolved in SERVER-26179 already, due to the mishandling of the buildIndexes false error.
      Old Description
      If I initialize a replica set with one member having buildIndexes set to false, that member gets stuck in STARTUP2.

      This bug appears in 3.3.14 but did not appear in 3.3.12.

        Attachments

        1. mongod-9005.log
          11 kB
        2. mongod-9006.log
          10 kB

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: