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

Change stream event with empty fullDocument field for existing document

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.0.19, 4.2.8, 5.0.0, 4.4.7
    • Component/s: Change streams, Sharding
    • Labels:
      None
    • Environment:
      I tested on host:
       - OS: Ubuntu 20.04 LTS
       - CPU: Intel i7-8700K
       - RAM: 64Gb
       - SSD: Samsung NVMe 500Gb
    • ALL
    • Hide

      On Linux host:

      Show
      On Linux host: checkout  https://github.com/bozaro/change-stream-test/ run `./run.sh`
    • Query 2020-11-30, Query 2020-12-14, Query 2020-12-28, Query 2021-01-11, Query 2021-01-25, Query Execution 2021-02-22, Query Execution 2021-03-08, Query Execution 2021-03-22, Query Execution 2021-04-05, Query Execution 2021-04-19, Sharding EMEA 2021-07-12, QE 2021-10-18

      On investigation flaky test in our codebase I found strange issue: sometimes I got change stream update event with empty fullDocument field for existing document.

      I reproduced this behaviour by looping with same collection:

      • drop collection;
      • shard collection;
      • open change stream;
      • run background thread which add ~2000 records and then update ~100 records;
      • read change stream and check then update event has non-empty fullDocument.

      Environment details:

      • one shard from single-node replicaset;
      • single-node configuration replicaset;
      • 3 mongos.

      On my computer, a spike of errors occurs in the first 10-30 iterations. Then the probability of errors greatly decreases.

      I wrote a simple program with Golang for reproducing this issue (main.go). This program uses go.mongodb.org/mongo-driver v1.3.4 for MongoDB access but originally this issue was reproduced with github.com/globalsign/mgo fork.

            Assignee:
            rishab.joshi@mongodb.com Rishab Joshi (Inactive)
            Reporter:
            bozaro@gmail.com Artem Navrotskiy
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: