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

Reading From Primary and secondary giving different sequence

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      MongoDB shard cluster (8 nodes) 5 replica in each set.

      Problem Statement/Rationale

      Sequence of data coming is different while reading from secondary and Primary

      Please be sure to attach relevant logs with any sensitive data redacted.

      Steps to Reproduce

      mongos> db.products.insertMany( [
      ...       { _id: 10, item: "1", qty: 20 },
      ...       { _id: 11, item: "2", qty: 20 },
      ...       { _id: 12, item: "3", qty: 20 }
      ...    ] );

       

      reading:

      mongos> db.products.find().readPref("primary")

      { "_id" : 10, "item" : "1", "qty" : 20 } { "_id" : 11, "item" : "2", "qty" : 20 } { "_id" : 12, "item" : "3", "qty" : 20 }

      mongos> db.products.find().readPref("secondary")

      { "_id" : 10, "item" : "1", "qty" : 20 } { "_id" : 12, "item" : "3", "qty" : 20 } { "_id" : 11, "item" : "2", "qty" : 20 }

      Expected Results

      reading from secondary should also come with same order without sorting that field.

      { "_id" : 10, "item" : "1", "qty" : 20 } { "_id" : 11, "item" : "2", "qty" : 20 } { "_id" : 12, "item" : "3", "qty" : 20 }

      Actual Results

      { "_id" : 10, "item" : "1", "qty" : 20 } { "_id" : 11, "item" : "2", "qty" : 20 } { "_id" : 12, "item" : "3", "qty" : 20 }

      Additional Notes

      Any additional information that may be useful to include.

            Assignee:
            yuan.fang@mongodb.com Yuan Fang
            Reporter:
            aayushi.mangal3@gmail.com Aayushi Mangal
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: