-
Type: Bug
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
Server Development Platform
-
Fully Compatible
-
ALL
-
I just ran into the following scenario:
1) Start a transaction
2) Do an update. This targets shard A.
3) Send a find command with readPreference: secondary. This targets the secondary of shard B.
4) NotMaster is returned with a TransientTransactionError.
5) The transaction gets retried over and over again with the same behavior.
Our docs for readPreference say "Multi-document transactions that contain read operations must use read preference primary." (https://docs.mongodb.com/manual/core/read-preference/) but given the above scenario, I'm wondering if we should do better and instead have the router throw some different, non-transient error if it notices that a statement in a multi-shard transaction is sent with readConcern: secondary. Alternatively the router could always upgrade the readPreference to be primary for commands running in a transaction.
- related to
-
SERVER-34557 Allow running transactions against primaries with readPreferences other than 'primary'
- Closed