[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: |
|
||||||||||||||||
| 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: |
| Comment by Githook User [ 09/Oct/20 ] |
|
Author: {'name': 'Gregory Wlodarek', 'email': 'gregory.wlodarek@mongodb.com', 'username': 'GWlodarek'}Message: |
| Comment by Gregory Wlodarek [ 02/Oct/20 ] |
|
This issue was fixed here as part of |
| 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. |