[SERVER-65137] detect namespace changes when refreshing Collection after yielding Created: 31/Mar/22  Updated: 29/Oct/23  Resolved: 07/Apr/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.3.2, 6.0.0-rc0, 5.0.9

Type: Bug Priority: Major - P3
Reporter: Benety Goh Assignee: Benety Goh
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-65547 unused CollectionMock constructor ove... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.3, v5.0
Sprint: Execution Team 2022-04-04, Execution Team 2022-04-18
Participants:
Linked BF Score: 136

 Description   

The LookupCollectionForYieldRestore functor, defined in collection_catalog.cpp, is responsible for looking up the collection in the catalog in order to restore the internal state of the CollectionPtr.

The functor returns a nullptr in the case of drops but still returns a non-null pointer if there was a rename while yielding. For renames, the resulting CollectionPtr state might be inconsistent with the resource IDs in the restored lock state. Additionally, since changes to the catalog results in new COW-induced versions of the catalog, there is a risk of a stale catalog.



 Comments   
Comment by Githook User [ 20/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 CollectionPtr::restore() should fail (return nullptr) if collection was renamed while yielding

(cherry picked from commit fed598b7d0b6c54d64138379a6ec11cfc601f7ae)
Branch: v5.0
https://github.com/mongodb/mongo/commit/43253c80d557e82f96c175d01c95953d506cceda

Comment by Githook User [ 18/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 LookupCollectionForYieldRestore saves collection namespace at construction

(cherry picked from commit 729774b7c096ef0a3a6158c5394245937b883667)
Branch: v5.0
https://github.com/mongodb/mongo/commit/8b00548ba9091f38b1e8ebab9aa329d5f366bd67

Comment by Githook User [ 15/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 add yield and restore tests for CollectionPtr

(cherry picked from commit 6e19cd516541894659878b5f4a9d291ebc2c574b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/7f77a0f04a16ef8964b07e24872372f8e6b862c2

Comment by Githook User [ 14/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 CollectionMock accepts UUID at construction

(cherry picked from commit 58dec1f1b5ae5f103b2adc343ef9231c44924102)
Branch: v5.0
https://github.com/mongodb/mongo/commit/1dfb79ae1f067837b6dbd858c88a986bc5dfec2b

Comment by Githook User [ 14/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 CollectionPtr::restore() should fail (return nullptr) if collection was renamed while yielding

(cherry picked from commit fed598b7d0b6c54d64138379a6ec11cfc601f7ae)
Branch: v5.3
https://github.com/mongodb/mongo/commit/841ee6f337ba7b6cc55db999a2455a517838e0e1

Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 LookupCollectionForYieldRestore saves collection namespace at construction

(cherry picked from commit 729774b7c096ef0a3a6158c5394245937b883667)
Branch: v5.3
https://github.com/mongodb/mongo/commit/7818bdcb10d520cb0f6685973c707ed5f292325a

Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 add yield and restore tests for CollectionPtr

(cherry picked from commit 6e19cd516541894659878b5f4a9d291ebc2c574b)
Branch: v5.3
https://github.com/mongodb/mongo/commit/8748f6b2a2a67282f48d84c1f69d07fc9616a54a

Comment by Githook User [ 13/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 CollectionMock accepts UUID at construction

(cherry picked from commit 58dec1f1b5ae5f103b2adc343ef9231c44924102)
Branch: v5.3
https://github.com/mongodb/mongo/commit/de7bb49a9645b6ff2ce58369eb12a65d5aaa3b2d

Comment by Githook User [ 06/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 CollectionPtr::restore() should fail (return nullptr) if collection was renamed while yielding
Branch: master
https://github.com/mongodb/mongo/commit/fed598b7d0b6c54d64138379a6ec11cfc601f7ae

Comment by Githook User [ 06/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 LookupCollectionForYieldRestore saves collection namespace at construction
Branch: master
https://github.com/mongodb/mongo/commit/729774b7c096ef0a3a6158c5394245937b883667

Comment by Githook User [ 06/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 add yield and restore tests for CollectionPtr
Branch: master
https://github.com/mongodb/mongo/commit/6e19cd516541894659878b5f4a9d291ebc2c574b

Comment by Githook User [ 05/Apr/22 ]

Author:

{'name': 'Benety Goh', 'email': 'benety@mongodb.com', 'username': 'benety'}

Message: SERVER-65137 CollectionMock accepts UUID at construction
Branch: master
https://github.com/mongodb/mongo/commit/58dec1f1b5ae5f103b2adc343ef9231c44924102

Generated at Thu Feb 08 06:01:57 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.