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

mongo tools seg fault in 2.2.0 with replica sets in connection string

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.2.3, 2.3.0
    • Affects Version/s: 2.2.0
    • Component/s: Tools
    • None
    • Environment:
      Linux Mint 12, CentOS 6.2
    • Fully Compatible
    • ALL

      Mongoimport started core dumping with replica sets when we upgraded to 2.2.0.

      I can reproduce it with a local three node replica set. When importing directly to PRIMARY everything works:

      mongoimport -h localhost -d test -c my_collection test.json
      connected to: localhost
      Tue Sep 11 10:27:55 imported 1 objects

      but if the set is added to the host string then mongoimport core dumps:

      mongoimport -h foo/localhost -d test -c my_collection test.json
      Tue Sep 11 10:21:59 starting new replica set monitor for replica set foo with seed of localhost:27017
      Tue Sep 11 10:21:59 successfully connected to seed localhost:27017 for replica set foo
      Tue Sep 11 10:21:59 changing hosts to

      { 0: "localhost:27017", 1: "localhost:27019", 2: "localhost:27018" }

      from foo/
      Tue Sep 11 10:21:59 trying to add new host localhost:27017 to replica set foo
      Tue Sep 11 10:21:59 successfully connected to new host localhost:27017 in replica set foo
      Tue Sep 11 10:21:59 trying to add new host localhost:27018 to replica set foo
      Tue Sep 11 10:21:59 successfully connected to new host localhost:27018 in replica set foo
      Tue Sep 11 10:21:59 trying to add new host localhost:27019 to replica set foo
      Tue Sep 11 10:21:59 successfully connected to new host localhost:27019 in replica set foo
      Tue Sep 11 10:21:59 Primary for replica set foo changed to localhost:27017
      Tue Sep 11 10:21:59 replica set monitor for replica set foo started, address is foo/localhost:27017,localhost:27018,localhost:27019
      Tue Sep 11 10:21:59 [ReplicaSetMonitorWatcher] starting
      connected to: foo/localhost
      Tue Sep 11 10:21:59 imported 1 objects
      Logstream::get called in uninitialized state
      Tue Sep 11 10:21:59 deleting replica set monitor for: foo/localhost:27017,localhost:27018,localhost:27019
      Segmentation fault

      It does not matter what kind of json document is imported, the one shown here is trivial:

      cat test.json
      {"menu": {"value": "File"}}

      I tried the exact same setup with Mongo 2.0.7 and everything works perfectly:

      mongoimport -h foo/localhost -d test -c my_collection test.json
      Tue Sep 11 10:33:06 starting new replica set monitor for replica set foo with seed of localhost
      Tue Sep 11 10:33:06 successfully connected to seed localhost for replica set foo
      Tue Sep 11 10:33:06 changing hosts to

      { 0: "localhost:27017", 1: "localhost:27019", 2: "localhost:27018" }

      from foo/
      Tue Sep 11 10:33:06 trying to add new host localhost:27017 to replica set foo
      Tue Sep 11 10:33:06 successfully connected to new host localhost:27017 in replica set foo
      Tue Sep 11 10:33:06 trying to add new host localhost:27018 to replica set foo
      Tue Sep 11 10:33:06 successfully connected to new host localhost:27018 in replica set foo
      Tue Sep 11 10:33:06 trying to add new host localhost:27019 to replica set foo
      Tue Sep 11 10:33:06 successfully connected to new host localhost:27019 in replica set foo
      Tue Sep 11 10:33:06 replica set monitor for replica set foo started, address is foo/localhost:27017,localhost:27018,localhost:27019
      Tue Sep 11 10:33:06 [ReplicaSetMonitorWatcher] starting
      connected to: foo/localhost
      imported 1 objects

            Assignee:
            siddharth.singh@10gen.com siddharth.singh@10gen.com
            Reporter:
            reynders Joonas Reynders
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: