Skip to content

mongodb: 3.3.2 driver unable to connect with replica set when one node is down. #6261

Closed
@yog27ray

Description

@yog27ray

MongoDB driver 3.3.2 is unable to connect to mongodb replicaSet if one of member machine is down.

Note: Same issue is described in https://jira.mongodb.org/browse/NODE-2231

Steps to reproduce

  1. Create mongodb replicaSet with 3 member.
  2. connect parse-server with mongodb providing all 3 member host name in uri.
  3. stop PRIMARY mongodb server
  4. MongoDB is able to select new PRIMARY from the available 2 member but parser-server is unable to connect to new PRIMARY mongodb node.

Note: Even we restart parse-server when one of the 3 member replicaSet mongodb is down and in mongo connection URI we have provided hostname for all the 3 member. It is not able to connect mongodb.

Expected Results

When one mongoDB replicaSet member goes down. It should automatically connect to new primary mongodb server.

Actual Outcome

Error: connect ECONNREFUSED x.x.x.x:port
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1128:14) {
name: 'MongoNetworkError',
errorLabels: [ 'TransientTransactionError' ],
[Symbol(mongoErrorContextSymbol)]: {}
}

Environment Setup

  • Server

    • parse-server : 3.9.0
    • Operating System: Ubuntu 18.04
    • Hardware: R4.2x.large
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): AWS
  • Database

    • MongoDB version: 4.2 (also tested on 4.0.9)
    • Storage engine: WireTigger
    • Hardware: R4.2x.large
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): AWS

Metadata

Metadata

Assignees

No one assigned

    Labels

    type:bugImpaired feature or lacking behavior that is likely assumed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions