Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-36526

There are no change stream events for collection on `mongos` with sharded cluster

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.1
    • Component/s: None
    • Labels:
      None
    • ALL
    • v4.0
    • Hide
      1. Run sharded cluster
      $ mongo --nodb
      new ShardingTest({ shards: 2, mongos: 1, rs: true })
      1. In another session connect to mongos and run simple script for insert 10 records per second:
      $ mongo mongodb://localhost:20009/foo
      MongoDB server version: 4.0.1
      mongos> for (;;) {db.bar.insert({_id: ObjectId()}); sleep(100);} 
      1. In third session connect to `mongos` and try to create change stream:
      $ mongo mongodb://localhost:20009/foo
      MongoDB server version: 4.0.1
      mongos> db.bar.count()
      13116
      mongos> db.bar.watch()
      mongos> 

      On this step I expected see a change stream events, but watch() method wait one second and return empty result.

      Show
      Run sharded cluster $ mongo --nodb new ShardingTest({ shards: 2, mongos: 1, rs: true }) In another session connect to mongos and run simple script for insert 10 records per second: $ mongo mongodb: //localhost:20009/foo MongoDB server version: 4.0.1 mongos> for (;;) {db.bar.insert({_id: ObjectId()}); sleep(100);} In third session connect to `mongos` and try to create change stream: $ mongo mongodb: //localhost:20009/foo MongoDB server version: 4.0.1 mongos> db.bar.count() 13116 mongos> db.bar.watch() mongos> On this step I expected see a change stream events, but watch() method wait one second and return empty result.
    • Query 2018-08-13, Query 2018-08-27

      I can't read change stream events from `mongos` on sharded cluster, but change stream worked on replica set node as expected.

       

      Version:

      $ mongo --version
      MongoDB shell version v4.0.1
      git version: 54f1582fc6eb01de4d4c42f26fc133e623f065fb
      allocator: system
      modules: none
      build environment:
          distarch: x86_64
          target_arch: x86_64 

            Assignee:
            nicholas.zolnierz@mongodb.com Nicholas Zolnierz
            Reporter:
            bozaro Artem
            Votes:
            0 Vote for this issue
            Watchers:
            13 Start watching this issue

              Created:
              Updated:
              Resolved: