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

Collection watcher resumability (ChangeStream)

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 4.11.0
    • Affects Version/s: 4.0.0, 4.1.0, 4.2.0, 4.3.0, 4.4.0, 4.5.0, 4.6.0, 4.7.0, 4.8.0
    • Component/s: Change Streams
    • 5
    • Not Needed
    • Not Needed

      What problem are you facing?

      We are on migration process of our Mongo servers to version 5.0. Making this happen, it was necessary an upgrade from our services to new driver (>=4.0) where we found a problem that didn't use to happen in a previous versions (<4.0).

      We have been using the Mongo resource "collection watcher" for update our caches into the applications, but we noticed that Mongo Atlas makes a not planning rebalance of the nodes ReplicaSet. When this happen the class ChangeStream receives a close signal and the applications stop receiving new database updates.

      What driver and relevant dependency versions are you using?

      Driver NODEJS version 4.8.0

      Steps to reproduce?

      1 - Create a basic ChangeStream and listen the close event;
      2 - Start application;
      3 - Execute failover test into the interface Mongo Atlas, or change the primary node of the replicaSet manually;
      4 - The application must receive close signal and stop receiving new updates.

       

      OBS:

      Hello Dears, this is the same problem reported on the issue NODE-3893.  In the last week was published a new driver version(4.8.0) with the promise our problem resolved, but not work as expected and the behavior is the same. I'am enriching this issue with a new video and environment details related with tests.

      Let us know if you need help with anything else.

      Environment Details:

      Mongo Atlas - Test Failover (Atlas resource for tests)
      Node Version - 14.17.5
      Mongodb Driver Version - 4.8.0
      URI Model: mongodb+srv://connectionString/DbName?retryWrites=true&w=majority Used code: Code sended by Alex Bevilacqua in NODE-3893.
      Mongo Server: 4.4.15

      Thank you

            Assignee:
            durran.jordan@mongodb.com Durran Jordan
            Reporter:
            davidson.morais@minutrade.com Davidson Morais
            Bailey Pearson
            Votes:
            16 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated:
              Resolved: