-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: 5.0.0, 6.0.0, 7.0.0, 8.0.0, 8.3.0-rc0, 8.2.0
-
Component/s: None
-
Catalog and Routing
-
Fully Compatible
-
ALL
-
v8.2, v8.0, v7.0
-
CAR Team 2025-10-27, CAR Team 2025-11-10, CAR Team 2025-11-24, CAR Team 2025-12-08, CAR Team 2025-12-22, CAR Team 2026-01-05
-
200
-
3
-
🟩 Routing and Topology
-
None
-
None
-
None
-
None
-
None
-
None
ISSUE DESCRIPTION AND IMPACT
When connecting directly to shard nodes instead of through mongos (including during a replica set promotion to sharded cluster), cluster-wide default read/write concerns may not be honored, causing writes to use {w: 1} instead of configured concerns, potentially losing acknowledged writes if rollback occurs.
DIAGNOSIS AND AFFECTED VERSIONS
Any direct shard operations without explicit read/write concerns are affected on the following MongoDB versions:
- 5.0.0 - 5.0.32
- 6.0.0 - 6.0.28
- 7.0.0 - 7.0.31
- 8.0.0 - 8.0.19
- 8.2.0 - 8.2.3
REMEDIATION AND WORKAROUNDS
Before promoting a replica set to a sharded cluster
- Upgrade to the latest MongoDB patch version
- If upgrading is not immediately possible, take one of the following precautions for future promotions:
- Specify explicit read and write concerns (e.g., {w: "majority"}) in your connection string, or
- Stop all application traffic before beginning the promotion
After promotion
- Update your application connection string to use mongos
- Restart your application to ensure it connects via mongos
—-----------------------------------------------------
Original description
Our default write concern system is only applied to replica set nodes under the assumption that the mongoS will specify the write concern within a sharded cluster. However, this means that during promotion to sharded when a replica set has been restarted with --shardsvr or --configsvr but connections haven't been switched to the mongos, the default write concern is not applied and thus we use the default constructed write concern options which is w:1.
This also applies to read concern though is less visible since the implicit default is the same as the normal default (local). But if the user has a cluster wide read concern default set, we will not honor it during the promotion (or via direct connections)
Â
- causes
-
SERVER-116129 Internal transactions should never specify empty read concern
-
- Closed
-
- is depended on by
-
SERVER-115806 Remove writeConcern override from transition to embedded csrs suite
-
- Backlog
-
- is related to
-
SERVER-45692 Ensure all internal inter-node commands which accept read/write concern explicitly specify it
-
- Closed
-
- related to
-
SERVER-115213 Replica set can be added to a sharded cluster with implicit default write concern {w: 1} and no cluster wide default set
-
- Closed
-
-
SERVER-116130 forceSyncSource helper hangs on shardsvr due to implicit majority write concern
-
- Closed
-
-
SERVER-44539 Re-enable "missing RWC" logging
-
- In Progress
-