-
Type:
Bug
-
Resolution: Duplicate
-
Priority:
Major - P3
-
None
-
Affects Version/s: 4.2.1
-
Component/s: Sharding
-
None
-
ALL
-
(copied to CRM)
I can't read data from mongos that was just inserted through another mongos.
The test is very simple, I have two mongos:
- connect mongos1
- shard Collection with hash index
- insert data
- query in mongos2 with readPref=secondary and readConcern=local/majority, no data returned.
- If I read from primary to trigger the cache route refresh, then data can be read.
This only happens in MongoDB 4.2 version with hash index key shardCollection method. If shard key is a range, everything works ok. If I shard Collection with hash index after data inserted, also everything is ok.
mongos> db.y.find({"_id" : ObjectId("601faa86dc371c32b4f58f6b")}).readPref("secondaryPreferred") mongos> db.y.find({"_id" : ObjectId("601faa86dc371c32b4f58f6b")}).readPref("secondaryPreferred").readConcern("local") mongos> db.y.find({"_id" : ObjectId("601faa86dc371c32b4f58f6b")}).readPref("secondaryPreferred").readConcern("majority") mongos> mongos> db.y.find({"_id" : ObjectId("601faa86dc371c32b4f58f6b")}) { "_id" : ObjectId("601faa86dc371c32b4f58f6b"), "y" : 1 } mongos> db.y.find({"_id" : ObjectId("601faa86dc371c32b4f58f6b")}).readPref("secondaryPreferred").readConcern("majority") { "_id" : ObjectId("601faa86dc371c32b4f58f6b"), "y" : 1 } mongos> mongos> mongos> db.z.find({"_id" : ObjectId("601faae5dc371c32b4f58f6e")}).readPref("secondaryPreferred") mongos> db.z.find({"_id" : ObjectId("601faae5dc371c32b4f58f6e")}).readPref("secondaryPreferred").readConcern("majority") mongos> mongos>
- duplicates
-
SERVER-53474 Cannot read from another mongos with secondaryPreferred after creating a new collection on one mongos
-
- Closed
-