[SERVER-31146] Rollback via refetch should only set collection options on local collection if they are non-empty Created: 18/Sep/17 Updated: 30/Oct/23 Resolved: 03/Oct/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.0-rc0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | William Schultz (Inactive) | Assignee: | William Schultz (Inactive) |
| 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 | |||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: |
This bug can also be demonstrated by adding a checkReplicatedDataHashes to the end of the existing rollback3.js test. |
|||||||||||||||||||||||||||||||||||||||
| Sprint: | Repl 2017-10-02, Repl 2017-10-23 | |||||||||||||||||||||||||||||||||||||||
| Participants: | ||||||||||||||||||||||||||||||||||||||||
| Description |
|
In rs_rollback.cpp, we resync metadata from certain collections if we need to, and then we update the CollectionOptions of our local collections here. It is possible for options validator, validationAction, validationLevel to be empty, but we don't check for that. So, if we call setValidationAction, for example, with an empty string, it actually sets it to the default validationAction, making our local collection options inconsistent with the upstream rollback node. For all collection options, we should only be setting them locally if the option we re-synced was non-empty. This seems to affect both the rollbackViaRefetch and the rollbackViaRefetchNoUUID algorithms. The rollbackViaRefetchNoUUID algorithm contains the same core logic as the 3.4 rollback algorithm, so it should affect v3.4 as well. |
| Comments |
| Comment by Githook User [ 03/Oct/17 ] |
|
Author: {'email': 'william.schultz@mongodb.com', 'name': 'William Schultz', 'username': 'will62794'}Message: |
| Comment by William Schultz (Inactive) [ 19/Sep/17 ] |
|
Yep, that's correct. |
| Comment by Spencer Brody (Inactive) [ 19/Sep/17 ] |
|
Sounds like this can result in the collection options being out of sync between members of the set - is that right? If so then this is 3.5 Required. |