Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-303

Cannot connect to healthy Replica Set if seedlist only contains a secondary

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 1.0.0-alpha1
    • Affects Version/s: 0.6.3
    • Component/s: None
    • None

      cat tests/connect/replicaset-seedlist-001.phpt

      --TEST--
      MongoDB\Driver\Manager: Connecting to Replica Set with only secondary in seedlist
      --SKIPIF--
      <?php require __DIR__ . "/../utils/basic-skipif.inc"; NEEDS("REPLICASET"); ?>
      <?php CLEANUP(REPLICASET); PREDICTABLE(); ?>
      --FILE--
      <?php
      require_once __DIR__ . "/../utils/basic.inc";
      
      
      $dsn = "mongodb://192.168.112.10:3001/?replicaSet=REPLICASET";
      $manager = new MongoDB\Driver\Manager($dsn);
      
      // load fixtures for test
      $bulk = new \MongoDB\Driver\BulkWrite();
      $bulk->insert(array("_id" => 1, "x" => 2, "y" => 3));
      $bulk->insert(array("_id" => 2, "x" => 3, "y" => 4));
      $bulk->insert(array("_id" => 3, "x" => 4, "y" => 5));
      $manager->executeBulkWrite(NS, $bulk);
      ?>
      ===DONE===
      <?php exit(0); ?>
      --EXPECT--
      ===DONE===
      

      Where port 3001 is a secondary (primary on 3000).
      Currently fails with:

      Fatal error: Uncaught exception 'RuntimeException' with message 'Timed out trying to select a server' in /home/bjori/Sources/phongo/tests/connect/replicaset-seedlist-001.phpt:19
      

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            bjori Hannes Magnusson
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: