[SERVER-46674] Comparing RWC by converting to BSON is not robust to concurrent FCV changes Created: 06/Mar/20 Updated: 29/Oct/23 Resolved: 12/Mar/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Sharding |
| Affects Version/s: | None |
| Fix Version/s: | 4.4.0-rc0, 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Kevin Pulo | Assignee: | Kevin Pulo |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Requested: |
v4.4
|
||||||||
| Sprint: | Sharding 2020-03-23 | ||||||||
| Participants: | |||||||||
| Linked BF Score: | 30 | ||||||||
| Description |
|
The serialisation of read/write concern may or may not include the provenance field, depending on the FCV. This means that if FCV is upgraded concurrently, such that one side of the BSON comparison includes provenance but the other doesn't, then the comparison result will be spurious. The only place this occurs is when making sure that commands don't alter the writeConcern during their runtime: https://github.com/mongodb/mongo/blob/r4.5.0/src/mongo/db/service_entry_point_common.cpp#L788
Possible solutions (in my suggested order of preference):
We should also improve the assertion so that it includes the conflicting writeConcerns in the message when it fails (in the non-opGetMore case). |
| Comments |
| Comment by Githook User [ 25/Mar/20 ] |
|
Author: {'email': 'kevin.pulo@mongodb.com', 'name': 'Kevin Pulo', 'username': 'devkev'}Message: (cherry picked from commit 339fe2c4fda1d54912f6d175caee4d8c3c801b71) |
| Comment by Githook User [ 12/Mar/20 ] |
|
Author: {'username': 'devkev', 'name': 'Kevin Pulo', 'email': 'kevin.pulo@mongodb.com'}Message: |