Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-1541

Not master error with findOneAndUpdate

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Critical - P2 Critical - P2
    • 3.1.3
    • Affects Version/s: 3.1.0
    • Component/s: None

      If I use mongodb ReplicaSet where I connect with ReadPreference other than 'primary' and use methods which returns data and update it with same atomic operation (for example 'findAndUpdate') then sometimes I get error (depends if read goes to secondary or not):

      MongoError: not master
      at /opt/app/node_modules/mongodb-core/lib/connection/pool.js:580:63
      at authenticateStragglers (/opt/app/node_modules/mongodb-core/lib/connection/pool.js:503:16)
      at Connection.messageHandler (/opt/app/node_modules/mongodb-core/lib/connection/pool.js:539:5)
      at emitMessageHandler (/opt/app/node_modules/mongodb-core/lib/connection/connection.js:309:10)
      at TLSSocket.<anonymous> (/opt/app/node_modules/mongodb-core/lib/connection/connection.js:452:17)
      at TLSSocket.emit (events.js:182:13)
      at TLSSocket.EventEmitter.emit (domain.js:442:20)
      at addChunk (_stream_readable.js:283:12)
      at readableAddChunk (_stream_readable.js:264:11)
      at TLSSocket.Readable.push (_stream_readable.js:219:10)
      at TLSWrap.onread (net.js:635:20)

       

      Problem appeared with latest driver 3.1.0. Before worked normally.

            Assignee:
            katherine.walker@mongodb.com Katherine Walker (Inactive)
            Reporter:
            mrkmrtns Marek Martins
            Votes:
            8 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: