[SERVER-45354] In renameCollectionAcrossDBs, writes to temporary collection must use correct timestamps Created: 03/Jan/20  Updated: 16/Oct/20  Resolved: 02/Oct/20

Status: Closed
Project: Core Server
Component/s: Replication, Storage
Affects Version/s: None
Fix Version/s: 4.4.2, 4.2.11

Type: Bug Priority: Major - P3
Reporter: Matthew Russotto Assignee: Gregory Wlodarek
Resolution: Duplicate Votes: 0
Labels: newgrad
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Duplicate
duplicates SERVER-48771 Enforce constraints on "multi-timesta... Closed
Operating System: ALL
Backport Requested:
v4.4, v4.2, v4.0, v3.6
Sprint: Execution Team 2020-10-19
Participants:
Linked BF Score: 10

 Description   

When we rename a collection across databases, we internally copy it. The copy operation writes multiple documents within a write unit of work without reserving timestamps, which results in wrong timestamps. We need to make sure the timestamps are written correctly.

It is possible that this could just be a matter of using write_ops_exec insertDocuments rather than writing the documents in a loop and directly calling Collection::insertDocument.



 Comments   
Comment by Githook User [ 16/Oct/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-45354 In renameCollectionAcrossDBs, writes to temporary collection must use correct timestamps
Branch: v4.2
https://github.com/mongodb/mongo/commit/e8c373424c6bd0460198b9a94936369e0a83b6f5

Comment by Githook User [ 09/Oct/20 ]

Author:

{'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}

Message: SERVER-45354 In renameCollectionAcrossDBs, writes to temporary collection must use correct timestamps
Branch: v4.4
https://github.com/mongodb/mongo/commit/f955f22b43229a73ff788127bd37ce651ad6f75e

Comment by Gregory Wlodarek [ 02/Oct/20 ]

This issue was fixed here as part of SERVER-48771. Because this is causing BFs on earlier branches we should consider backporting that specific change to 4.0->4.4.

Comment by Matthew Russotto [ 06/Jan/20 ]

After some consideration, we don't think this bug is normally user-visible. It results in timestamped reads seeing inconsistency in the temporary collection during the copy, and if a rollback occurs on the primary may result in the temporary collection being inconsistent with the oplog. However, on rollback the temporary collection will be removed anyway. If the rename completes successfully (and is not rolled back), the final collection will always be consistent.

Generated at Thu Feb 08 05:08:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.