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.
|