Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-258

tools should verify host argument's replica set name

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.8.0-rc3
    • Fix Version/s: 2.8.0-rc4
    • Component/s: All Tools
    • Labels:
      None

      Description

      We currently do not validate the replset name in the current tools. e.g. in legacy mongoimport

      $ mongoimport  a.b.c.json --host dreplset/localhost:27017 --drop
      2014-10-03T18:26:24.836-0400 starting new replica set monitor for replica set dreplset with seeds localhost:27017
      2014-10-03T18:26:24.836-0400 [ReplicaSetMonitorWatcher] starting
      2014-10-03T18:26:24.837-0400 warning: node: localhost:27017 isn't a part of set: dreplset ismaster: { setName: "replset", setVersion: 1, ismaster: true, secondary: false, hosts: [ "Wisdoms-MacBook-Pro.local:27017", "Wisdoms-MacBook-Pro.local:27019", "Wisdoms-MacBook-Pro.local:27018" ], primary: "Wisdoms-MacBook-Pro.local:27017", me: "Wisdoms-MacBook-Pro.local:27017", maxBsonObjectSize: 16777216, maxMessageSizeBytes: 48000000, maxWriteBatchSize: 1000, localTime: new Date(1412375184837), maxWireVersion: 3, minWireVersion: 0, ok: 1.0 }
      2014-10-03T18:26:24.837-0400 warning: No primary detected for set dreplset
      2014-10-03T18:26:24.837-0400 All nodes for set dreplset are down. This has happened for 1 checks in a row. Polling will stop after 29 more failed checks
      couldn't connect to [dreplset/localhost:27017] connect failed to replica set dreplset/localhost:27017

      In the new tools:

      $ mongoimport a.b.c.json --host dreplset/localhost:27017 --drop
      2014-10-03T18:28:44.672-0400	no collection specified
      2014-10-03T18:28:44.673-0400	using filename 'a.b.c' as collection
      2014-10-03T18:28:44.673-0400	connected to: dreplset/localhost:27017
      2014-10-03T18:28:44.675-0400	dropping: test.a.b.c
      2014-10-03T18:28:44.680-0400	imported 10 documents

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              adinoyi.omuya Adinoyi Omuya
              Reporter:
              adinoyi.omuya Adinoyi Omuya
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: