[SERVER-32274] Do not timestamp applyOps writes on standalones Created: 12/Dec/17 Updated: 30/Oct/23 Resolved: 18/Dec/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Replication, Storage |
| Affects Version/s: | None |
| Fix Version/s: | 3.6.3, 3.7.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Judah Schvimer | Assignee: | Judah Schvimer |
| 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: |
v3.6
|
||||
| Sprint: | Repl 2017-12-18, Repl 2018-01-01 | ||||
| Participants: | |||||
| Description |
|
We put in a back-door here so that we could unittest timestamps. It says that non-master-slave, non-replicated applyOps writes are timestamped with their provided timestamps. This means that standalone applyOps writes will get timestamped with the provided timestamps. If the provided timestamps are out of order (which is almost certain), that will cause a problem. |
| Comments |
| Comment by Githook User [ 19/Jan/18 ] |
|
Author: {'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}Message: (cherry picked from commit 202a1d1692c5350f1de66bf357c617c24d211c94) |
| Comment by Githook User [ 18/Dec/17 ] |
|
Author: {'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}Message: |
| Comment by Eric Milkie [ 13/Dec/17 ] |
|
That is, in effect, what Judah did here. We removed the backdoor. |
| Comment by Andy Schwerin [ 13/Dec/17 ] |
|
Could we restructure the tests so that we don't need the backdoor? Adding code to the server that should only run in tests is a last resort. |
| Comment by Daniel Gottlieb (Inactive) [ 12/Dec/17 ] |
|
Clarification: atomic `applyOps` (all CRUD operations) are performed in an `UnreplicatedWritesBlock`, while non-atomic operations are not. Right now the only way to have a standalone timestamp writes is to perform a non-atomic `applyOps`, but inside an `UnreplicatedWritesBlock`. I believe this is only possible from within the server e.g: cpp unitttests |
| Comment by Judah Schvimer [ 12/Dec/17 ] |
|
This probably is not actually a problem since we don't use "UnreplicatedWriteBlocks" to prevent replication for standalones, we check explicitly in isOplogDisabledFor, however this is still misleading and leaves the opening for future bugs. |