[SERVER-33719] createCollectionForApplyOps should invariant that collections are not renamed in replication steady state Created: 07/Mar/18  Updated: 29/Oct/23  Resolved: 07/Jan/20

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.3.3

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Daniel Ernst
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-33714 Downgrading FCV from 3.6 to 3.4 leave... Closed
is related to SERVER-21700 Do not relax constraints during stead... Closed
is related to SERVER-49930 Log collection name in createCollecti... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2019-12-30, Execution Team 2020-01-13, Execution Team 2019-12-30
Participants:

 Description   

createCollectionForApplyOps runs on secondaries and has functionality to temporarily rename a collection out of the way into a tmp collection, with the expectation that it will be renamed back again. This is for oplog replay when this scenario happens:

1) createCollection(foo.bar) w/ UUID 1
2) renameCollection(foo.bar to foo.baz) still w/ UUID 1
3) createCollection(foo.bar) w/ UUID 2

createCollectionForApplyOps will rename foo.bar w/ UUID 2 out of the way into a tmp collection when it sees 1) and create foo.bar w/ UUID 1, with the expectation that it will eventually see 3) and rename the tmp collection back.

However, this code can leak bugs. When secondaries somehow have a collection that the primary doesn't, and the primary then creates the collection and the secondaries rename their original collection out of the way, orphaning it.



 Comments   
Comment by Githook User [ 07/Jan/20 ]

Author:

{'name': 'Daniel Ernst', 'email': 'daniel.ernst@mongodb.com'}

Message: SERVER-33719 Invariant if createCollectionForApplyOps renames collection in steady state repl
Branch: master
https://github.com/mongodb/mongo/commit/1f192f23d93b4e01b96567fa4a1d061b625d95a2

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