[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:
Backports
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: SERVER-32274 Never timestamp applyOps writes on standalones

(cherry picked from commit 202a1d1692c5350f1de66bf357c617c24d211c94)
Branch: v3.6
https://github.com/mongodb/mongo/commit/8ce8393704affc11a7844e90be93de14669c672a

Comment by Githook User [ 18/Dec/17 ]

Author:

{'name': 'Judah Schvimer', 'email': 'judah@mongodb.com', 'username': 'judahschvimer'}

Message: SERVER-32274 Never timestamp applyOps writes on standalones
Branch: master
https://github.com/mongodb/mongo/commit/202a1d1692c5350f1de66bf357c617c24d211c94

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.

Generated at Thu Feb 08 04:29:45 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.