[SERVER-74043] Reading From Primary and secondary giving different sequence Created: 15/Feb/23  Updated: 15/Feb/23  Resolved: 15/Feb/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Aayushi Mangal Assignee: Yuan Fang
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MongoDB shard cluster (8 nodes) 5 replica in each set.


Participants:

 Description   

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.


Generated at Thu Feb 08 06:26:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.