[SERVER-57775] collection metadata for multikey not removed after WriteConflictException from durable catalog update Created: 17/Jun/21  Updated: 29/Oct/23  Resolved: 21/Jun/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 5.0.0-rc5, 5.1.0-rc0

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-57786 include collection UUID and redacted ... Closed
is related to SERVER-56002 listIndexes can read partial state fr... Closed
is related to SERVER-56023 listCollections can return empty meta... Closed
is related to SERVER-56877 insert operations may fail to set ind... Closed
is related to SERVER-57127 Refactor multikey and other state out... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.0
Sprint: Execution Team 2021-06-28
Participants:
Linked BF Score: 127

 Description   

The collection metadata in CollectionImpl tracks both the uncommitted changes in memory and the persisted state in DurableCatalog. The IndexCatalogEntry updates the collection metadata for multikey by calling CollectionImpl::setIndexIsMultikey(). All updates on the collection metadata has to be done in a storage transaction (WriteUnitOfWork) with cleanup handlers to clear the uncommitted state if the transaction is aborted. If a WriteConflictException is thrown from DurableCatalog::putMetaData() before the rollback handler to remove the uncommitted multikey state is installed, we may end up with a collection metadata state where subsequent writers may observe uncommitted multikey information that should have been discarded.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 24/Jun/21 ]

Author:

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

Message: SERVER-57775 CollectionImpl removes uncommitted multikey state if DurableCatalog::putMetaData() fails

(cherry picked from commit 91a631f40727f00140bc652d13a3058a8fbbf314)
Branch: v5.0
https://github.com/mongodb/mongo/commit/ff5ac33fbb9e92a50b641d4007cfd9b05c6ed225

Comment by Githook User [ 24/Jun/21 ]

Author:

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

Message: SERVER-57775 add tests for Collection::setIndexIsMultikey()

(cherry picked from commit 360823520e1ba097d9f7afedc20863124ddaccf6)
Branch: v5.0
https://github.com/mongodb/mongo/commit/c6ebda4b612b0f1da93e1892a3765c9581f3dc62

Comment by Githook User [ 24/Jun/21 ]

Author:

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

Message: SERVER-57775 add EFTAlwaysThrowWCEOnWrite fail point

This serves a similar purpose to WTWriteConflictException for the WiredTiger storage engine.

(cherry picked from commit 9753384b0dd1897fd4373ac8325d20cf80cdceec)
Branch: v5.0
https://github.com/mongodb/mongo/commit/e2162a7e9258a7e7e85e1413c0395c5526d00e32

Comment by Githook User [ 18/Jun/21 ]

Author:

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

Message: SERVER-57775 CollectionImpl removes uncommitted multikey state if DurableCatalog::putMetaData() fails
Branch: master
https://github.com/mongodb/mongo/commit/91a631f40727f00140bc652d13a3058a8fbbf314

Comment by Githook User [ 17/Jun/21 ]

Author:

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

Message: SERVER-57775 add tests for Collection::setIndexIsMultikey()
Branch: master
https://github.com/mongodb/mongo/commit/360823520e1ba097d9f7afedc20863124ddaccf6

Comment by Githook User [ 17/Jun/21 ]

Author:

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

Message: SERVER-57775 add EFTAlwaysThrowWCEOnWrite fail point

This serves a similar purpose to WTWriteConflictException for the WiredTiger storage engine.
Branch: master
https://github.com/mongodb/mongo/commit/9753384b0dd1897fd4373ac8325d20cf80cdceec

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